Program: 37417
Project: 37417
Buggy source:
/** 
 * Execute the given SQL script. <p> The script will typically be loaded from the classpath. There should be one statement per line. Any semicolons and line comments will be removed. <p> <b>Do not use this method to execute DDL if you expect rollback.</b>
 * @param jdbcTemplate the JdbcTemplate with which to perform JDBC operations
 * @param resource the resource (potentially associated with a specific encoding) to load the SQL script from
 * @param continueOnError whether or not to continue without throwing an exception in the event of an error
 * @throws DataAccessException if there is an error executing a statement and {@code continueOnError} is {@code false}
 * @see ResourceDatabasePopulator
 */
private static void executeSqlScript(JdbcTemplate jdbcTemplate,EncodedResource resource,String databaseName,boolean continueOnError) throws DataAccessException {
  long startTime=System.currentTimeMillis();
  List<String> statements=new LinkedList<String>();
  LineNumberReader reader=null;
  try {
    reader=new LineNumberReader(resource.getReader());
    String script=readScript(reader);
    char delimiter=DEFAULT_STATEMENT_SEPARATOR;
    if (!containsSqlScriptDelimiters(script,delimiter)) {
      delimiter='\n';
    }
    splitSqlScript(script,delimiter,statements);
    int lineNumber=0;
    for (    String statement : statements) {
      lineNumber++;
      try {
        jdbcTemplate.update("String_Node_Str" + databaseName + "String_Node_Str");
      }
 catch (      DataAccessException ex) {
        LOGGER.error("String_Node_Str",databaseName,ex.getMessage());
      }
      try {
        int rowsAffected=jdbcTemplate.update(statement);
        LOGGER.info(rowsAffected + "String_Node_Str" + statement);
      }
 catch (      DataAccessException ex) {
        if (continueOnError) {
          LOGGER.error("String_Node_Str" + lineNumber + "String_Node_Str"+ resource+ "String_Node_Str"+ statement,ex);
        }
 else {
          throw ex;
        }
      }
    }
    long elapsedTime=System.currentTimeMillis() - startTime;
    LOGGER.info(String.format("String_Node_Str",resource,elapsedTime));
  }
 catch (  IOException ex) {
    throw new DataAccessResourceFailureException("String_Node_Str" + resource,ex);
  }
 finally {
    try {
      if (reader != null) {
        reader.close();
      }
    }
 catch (    IOException ex) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Execute the given SQL script. <p> The script will typically be loaded from the classpath. There should be one statement per line. Any semicolons and line comments will be removed. <p> <b>Do not use this method to execute DDL if you expect rollback.</b>
 * @param jdbcTemplate the JdbcTemplate with which to perform JDBC operations
 * @param resource the resource (potentially associated with a specific encoding) to load the SQL script from
 * @param continueOnError whether or not to continue without throwing an exception in the event of an error
 * @throws DataAccessException if there is an error executing a statement and {@code continueOnError} is {@code false}
 * @see ResourceDatabasePopulator
 */
private static void executeSqlScript(JdbcTemplate jdbcTemplate,EncodedResource resource,String databaseName,boolean continueOnError) throws DataAccessException {
  long startTime=System.currentTimeMillis();
  List<String> statements=new LinkedList<String>();
  LineNumberReader reader=null;
  try {
    reader=new LineNumberReader(resource.getReader());
    String script=readScript(reader);
    char delimiter=DEFAULT_STATEMENT_SEPARATOR;
    if (!containsSqlScriptDelimiters(script,delimiter)) {
      delimiter='\n';
    }
    splitSqlScript(script,delimiter,statements);
    int lineNumber=0;
    for (    String statement : statements) {
      lineNumber++;
      executeUseDatabaseStatement(statement,jdbcTemplate,databaseName);
      try {
        int rowsAffected=jdbcTemplate.update(statement);
        LOGGER.info(rowsAffected + "String_Node_Str" + statement);
      }
 catch (      DataAccessException ex) {
        if (continueOnError) {
          LOGGER.error("String_Node_Str" + lineNumber + "String_Node_Str"+ resource+ "String_Node_Str"+ statement,ex);
        }
 else {
          throw ex;
        }
      }
    }
    long elapsedTime=System.currentTimeMillis() - startTime;
    LOGGER.info(String.format("String_Node_Str",resource,elapsedTime));
  }
 catch (  IOException ex) {
    throw new DataAccessResourceFailureException("String_Node_Str" + resource,ex);
  }
 finally {
    try {
      if (reader != null) {
        reader.close();
      }
    }
 catch (    IOException ex) {
    }
  }
}