> > tony schrieb:
> > > Is it possible to run multiple select statements in one (Java)
[quoted text clipped - 19 lines]
> http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html#addBatch(java.la
ng.String)
> http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html#executeBatch()
The Batch methods are intended for update statements, not for queries. If your DBMS
supports sending multiple queries at once (usually separated by semicolons), you should
be able to use getMoreResults() in java.sql.Statement to retrieve resultsets from
subsequent queries. Please the docs on getMoreResults() very closely.

Signature
Lee Fesperman, FirstSQL, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
Abdullah Kauchali - 28 Apr 2004 00:11 GMT
"Lee Fesperman" <firstsql@ix.netcom.com> wrote in message
> The Batch methods are intended for update statements, not for queries. If your DBMS
> supports sending multiple queries at once (usually separated by semicolons), you should
> be able to use getMoreResults() in java.sql.Statement to retrieve resultsets from
> subsequent queries. Please the docs on getMoreResults() very closely.
I was also after something like this recently. :)
The real trick of these JDBC drivers that support "multiple queries" at the
same time would be to execute all at once and return all at once (ie. one
roundtrip to the database). Instead of going to the server each time for
"getMoreResults" - which would defeat the purpose, IMO.
There is a similar functionality with Microsoft's ADO Recordset called
getNextRecordset ... which certainly goes to the server for the next
recordset even though you submitted the queries all at once. :)
Kind regards
Abdullah