Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Prepared Statement Compilation

 
Josweth Reddy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai ,
We know that PreparedStatement is a precompiled statement..
But who provides the implementation for the compiled PreparedStatement
I mean as it is in "java.sql" ,Will java compiles and provides the implentation??.

Please clarify...

Thanking you,
Josweth Reddy
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, the PreparedStatement Java object is (usually) not the compiled SQL statement itself. Instead, it contains a handle or reference to the compiled statement that exists within the database itself. The major possible exceptions to this are embedded Java databases (where the PreparedStatement implementation mighthold the compiled SQL statement), and database drivers that don't support true compilation (where PreparedStatement is implemented as a wrapper class around Statement).

It's the driver writer's responsibility to get all this right; you just have to get the right driver for your database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic