Hi,
I guess you used: PreparedStatement prep =
conn.prepareStatement("insert into my_table (a, b) values (?, ?);
insert into another_table (c, d) values (?, ?)");
Unfortunately this is not supported. H2 can execute multiple
statements, for example "create table a(id int); create table b(id
int)" - but it doesn't support prepared statements with parameters.
Multiple statements are supported for compatibility with HSQLDB,
however I think with HSQLDB 2.0 it is also no longer supported. I
don't think other databases support this feature (or do they? which
ones?).
Why do you want to execute multiple statements in one call? If it's
for performance over remote connections, I suggest to use a user
defined java function. If it's because you want to execute it in the
same transaction, I suggest to use Connection.setAutoCommit(false).
Regards,
Thomas
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.