• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

prepared statement

 
Rambabu Gonela
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic