my dog learned polymorphism*
The moose likes JDBC and the fly likes doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "doubt" Watch "doubt" New topic
Author

doubt

Maya Pillai
Ranch Hand

Joined: Jul 17, 2008
Posts: 60
Can I reuse a Statement/Prepared Statement or must I create a new one for each query?

Please help
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Maya Pillai wrote:Can I reuse a Statement/Prepared Statement or must I create a new one for each query?

Please help


Yes you can OR you can try with a small program to ensure it.. I used it with one precautions while using PreparedStatement, which is clear all the parameters before assigning it different query.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38041
    
  22
Please don't use thread titles like "doubt;" people like to know what the thread is about.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubt
 
Similar Threads
How to update a database using web forms
Exercise Problem...
regarding listeners
Urgent Java interview question 6+ yrs exp.
How to submit a null in radio button