Can I use more than one Resultset objects through as many Statement objects using a single Connection object...when i am doing this ,there is an error message" connection is already busy with another statement". Please help me to sort it out

Recommended Answers

All 5 Replies

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

that would be one resultset per statement, not per connection.

that would be one resultset per statement, not per connection.

Yep. Hate those little (BIG) mistypes. ;-)

that would be one resultset per statement, not per connection.

multiple resultset are working only when all other except one are closed ...but my requirement is to keep all the resultsets open simultaneously . can this be possible..?

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.