Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not clear about PreparedStatement

 
jayram
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you are correct regarding prepared statements.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic