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 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 and Relational Databases
Bookmark "Not clear about PreparedStatement" Watch "Not clear about PreparedStatement" New topic

Not clear about PreparedStatement

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.

So much trouble in the world -- Bob Marley
I agree. Here's the link:
subject: Not clear about PreparedStatement
It's not a secret anymore!