You can have multiple statements on one connection (though only one resultset per connection, normally), but seemingly, your connection can only have one statement active at the same time. Are you, per chancce, using the JDBC-ODBC Bridge, if so take a look at this:
http://java.sun.com/products/jdbc/faq.html#15
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
that would be one resultset per statement, not per connection.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
that would be one resultset per statement, not per connection.
Yep. Hate those little (BIG) mistypes. ;-)
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
If they are coming from the same statement, no. The API clearly says that any time a statement executes a query, all previous resultsets will be closed. Multiple statements on the same connection will allow you to have multiple resultsets. One per statement. However, as has been pointed out, if you are using the JDBC-ODBC bridge you may only have one statement at a time.
What DB are connecting to, and what Driver are you using?
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494