Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes JDBC and Relational Databases and the fly likes prepared statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "prepared statement" Watch "prepared statement" New topic
Author

prepared statement

Rambabu Gonela
Greenhorn

Joined: Jul 31, 2006
Posts: 24
Hello..

prepared statement in jdbc means its precompiled statement.. ok..i have one doubt .. where it will compile? in java compiler or any other compiler.. and where it will store after compilation
Srikanth Ramu
Ranch Hand

Joined: Feb 20, 2007
Posts: 76
PreparedStatement is an interface and it varys from one Driver to another driver implementation. However mostly the SQLs are compiled in the Database.
Jeff Ash
Greenhorn

Joined: Apr 07, 2007
Posts: 11
Compile is probably not the best term when speaking of PreparedStatement. Basically, the database parses the SQL and gets the statement ready for execution. When you change bound parameter values in a PreparedStatement, the database does not need to reparse the SQL and prepare for execution, it can simply update a few variables and then it's ready to go.

Think of it as more of a caching mechanism.


Jeff Ash<br /><a href="http://www.excellentiasoftware.com" target="_blank" rel="nofollow">Excellentia Software</a>
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: prepared statement