jQuery in Action, 2nd edition
The moose likes JDBC and Relational Databases 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


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 286
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Can i use only one connection and only one statement to execute multiple queries