File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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