954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

jdbc problem

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

pradeep.singh28
Newbie Poster
10 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

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
Moderator
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
Team Colleague
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
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 
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..?

pradeep.singh28
Newbie Poster
10 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

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
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You