I have a files containing sql scripts both DDL and DML scripts like create, insert, update, delete, create views etc.
i need to split them correctly an execute them, any suggestions..
thanks in advance
I have a files containing sql scripts both DDL and DML scripts like create, insert, update, delete, create views etc.
i need to split them correctly an execute them, any suggestions..
thanks in advance
eventually duplicated question: Split multiple SQL statements into individual SQL statements
To execute you could use something like:
Statement stmt = conn.createStatement();
for(String statement : statements) {
stmt.addBatch(statement);
}
stmt.executeBatch();