Reputation: 60778
This command:
INSERT INTO t1 values (d1)
INSERT INTO t2 values (d2)
I want to run in one prepared statement. Logically they should be transactional so wrapped in a block. Is this possible in JDBC which I understand doesn't allow multiple SQL operations per update?
Upvotes: 0
Views: 1613
Reputation: 7212
You need to begin a transaction, run both inserts, then commit. Or look into allowMultiQueries=true in your JDBC connection parameters.
Upvotes: 1