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

Preparestatement Class

 
laila NiHai
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have many repreated queries and would like to set up PreparedStatements and use a class for each query that returns the ResultSet. Do you know of any examples to do so? I am fuzzy on how to handle setting the parameters for the preparedstatement that has different data types. I would appreciate any pointers you may have....
 
Paul Clapham
Sheriff
Pie
Posts: 20185
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't know of any specific examples, but when I put "preparedstatement tutorial" into Google, the first link that came back was the Oracle tutorial: Using Prepared Statements. When your web search produces a list of tutorials, usually the best choice is the Oracle tutorial if there is one.
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
laila NiHai wrote:Hello,

I have many repreated queries and would like to set up PreparedStatements and use a class for each query that returns the ResultSet. Do you know of any examples to do so? I am fuzzy on how to handle setting the parameters for the preparedstatement that has different data types. I would appreciate any pointers you may have....


Just like Paul says, you'll be best served to check the tutorial, then make an attempt to code a simple prepared statement. If you get stuck, post what code you have. You can also search in Google Code Search for preparedStatement:
http://www.google.com/codesearch?as_q=preparedStatement&btnG=Search+Code&hl=en&as_package=&as_lang=java&as_filename=&as_class=&as_function=&as_license=&as_case=yes
 
laila NiHai
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul and Tim for the pointers. I never knew Google Code Search existed. Learning something new everyday...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic