My statement:
statement.addBatch("START TRANSACTION;" +
"UPDATE FIRST_TABLE SET FIRST_FIELD = 1;" +
"UPDATE SECOND_TABLE SET SECOND_FIELD = 2;" +
"UPDATE THIRD_TABLE SET THIRD_FIELD = 3;" +
"COMMIT;");
And exception throws in next line:
statement.executeBatch();
The same thing happens if I use the method execute:
statement.execute(myTransaction);
The exception:
java.sql.BatchUpdateException: ORA-00900: invalid SQL statement
I use Oracle. I don’t have any exception if I execute this statement in command line or SQL IDE. It works properly in this case. There is this exception only in java code. What is wrong?
Try,