How can I execute SQL file that contains more than one SQL statements. I tried using following code:
task testSql {
gradle.class.classLoader.addURL(new File(‘BuildOutput/SQL/ojdbc6.jar’).toURI().toURL())
def sql = groovy.sql.Sql.newInstance(JDBCURL, DB_PROP_SCHEMA , DB_PROP_PASSWORD , ‘allowMultiQueries=true’, ‘oracle.jdbc.driver.OracleDriver’)
String sqlFilePath = 'testsql/testsqls.sql’
String sqlString = new File(sqlFilePath).text
sql.execute(sqlString)
sql.close()
}
but it is giving error:SQL command not properly ended