File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "prepared statement" Watch "prepared statement" New topic

prepared statement

Rambabu Gonela

Joined: Jul 31, 2006
Posts: 24

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

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="" target="_blank" rel="nofollow">Excellentia Software</a>
I agree. Here's the link:
subject: prepared statement
It's not a secret anymore!