aspose file tools*
The moose likes JDBC and the fly likes Not clear about PreparedStatement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Not clear about PreparedStatement" Watch "Not clear about PreparedStatement" New topic
Author

Not clear about PreparedStatement

jayram
Ranch Hand

Joined: Oct 30, 2000
Posts: 94
Can anyone please clarify whats exact difference between a Statement and a PreparedStatement?? From what i can understand Statements are parsed and compiled every time it is executed while PreparedStatement is precompiled. Does that mean that if same querry is executed by multiple clients at different instances of time and if it is executed using PreparedStatement it will not be parse compiled for each client request?? Is this a guranteed behaviour across different JDBC drivers and databases??
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Yes, you are correct regarding prepared statements.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Not clear about PreparedStatement