• Post Reply Bookmark Topic Watch Topic
  • New Topic

doubt

 
Maya Pillai
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I reuse a Statement/Prepared Statement or must I create a new one for each query?

Please help
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Marshal
Posts: 53140
124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't use thread titles like "doubt;" people like to know what the thread is about.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!