This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Statement for more then one insert quries

 
ehsan ulhaq dar
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my bean class i execute more then one insert quries. Whether i use only one statement object to execute these quries or i used separate statement object for separate qury? What is sun recommendation?
 
Jan Cumps
Bartender
Posts: 2577
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ehsan,

You can reuse the object.
Regards, Jan
 
Scott Selikoff
author
Saloon Keeper
Posts: 3900
16
Eclipse IDE Flex Google Web Toolkit
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Statements can be re-used although unless the queries are strongly related its often a better design to close and finish your first statement and open a new statement elsewhere. In other words, don't keep a single statement for the entire JDBC application, as your likely to have issues with opening/closing it if an exception occurs.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic