#vulnerable code 
                                public void doGenerate(String excludeTables) {

        System.out.println("start generate...");
        DatasourceConfig datasourceConfig = JbootProperties.get("jboot.datasource", DatasourceConfig.class);

        HikariConfig config = new HikariConfig();
        config.setJdbcUrl(datasourceConfig.getUrl());
        config.setUsername(datasourceConfig.getUser());
        config.setPassword(datasourceConfig.getPassword());
        config.addDataSourceProperty("cachePrepStmts", "true");
        config.addDataSourceProperty("prepStmtCacheSize", "250");
        config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
        config.setDriverClassName("com.mysql.jdbc.Driver");

        HikariDataSource dataSource = new HikariDataSource(config);

        List<TableMeta> tableMetaList = new MetaBuilder(dataSource).build();

        if (StringUtils.isNotBlank(excludeTables)) {
            List<TableMeta> newTableMetaList = new ArrayList<>();
            Set<String> excludeTableSet = StringUtils.splitToSet(excludeTables.toLowerCase(), ",");
            for (TableMeta tableMeta : tableMetaList) {
                if (excludeTableSet.contains(tableMeta.name.toLowerCase())) {
                    System.out.println("exclude table : " + tableMeta.name);
                    continue;
                }
                newTableMetaList.add(tableMeta);
            }
            tableMetaList = newTableMetaList;
        }

        new JbootServiceInterfaceGenerator(basePackage, modelPacket).generate(tableMetaList);
        new JbootServiceImplGenerator(basePackage + ".impl", modelPacket).generate(tableMetaList);


        System.out.println("service generate finished !!!");

    } 
                            #location 17 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public void doGenerate(String excludeTables) {

        System.out.println("start generate...");
        DataSource dataSource = CodeGenHelpler.getDatasource();
        List<TableMeta> tableMetaList = new MetaBuilder(dataSource).build();
        CodeGenHelpler.excludeTables(tableMetaList, excludeTables);

        new JbootServiceInterfaceGenerator(basePackage, modelPacket).generate(tableMetaList);
        new JbootServiceImplGenerator(basePackage + ".impl", modelPacket).generate(tableMetaList);


        System.out.println("service generate finished !!!");

    }