wood burning stoves 2.0*
The moose likes JDBC and the fly likes Can i use only one connection and only one statement to execute multiple queries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Can i use only one connection and only one statement to execute multiple queries" Watch "Can i use only one connection and only one statement to execute multiple queries" New topic
Author

Can i use only one connection and only one statement to execute multiple queries

yashpal waghmare
Greenhorn

Joined: Sep 17, 2008
Posts: 22
Can i use only one connection and only one statement to execute multiple queries and How?
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi Yashpal,

Did you try/test this out your own? If YES, did you encounter any problem?


cmbhatt
raj malhotra
Ranch Hand

Joined: Feb 22, 2007
Posts: 285
you can reuse single connection as long as it is not closed .And you can run multiple queries using batch update.

Thanks
Raj
yashpal waghmare
Greenhorn

Joined: Sep 17, 2008
Posts: 22
Originally posted by Chandra Bhatt:
Hi Yashpal,

Did you try/test this out your own? If YES, did you encounter any problem?


Yes i tried , its giving problem while using same.
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi Yashpal,

Will you share the problem that you faced with us please?
Paste stack trace of the exception you get, or you can elaborate
your problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can i use only one connection and only one statement to execute multiple queries
 
Similar Threads
select and update using the same statement object
prepared statement Vs Stored procedures
performant connection management
Using statement object for multiple queries
Returning DB connection