Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tell me the main difference between Statement and PreparedStatement?

 
Rama Satti
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hai to all,

Can any one tell me the important differences between Statement and PreparedStatement?

Thanks in Advance

Regards
SRK
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google can help

Search
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65337
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on Servlets.

For more information, please read this.

This post has been moved to a more appropriate forum.
 
Amaan khan
Greenhorn
Posts: 14
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main difference is PreparedStatement can be used to supply the parameters to the SQL queries on the runtime using some html /jsp forms or things like that. Statement Object cannot allow us to do that.
There are many more differences but significantly this one more than enough for us to use PreparedStatement in place of Statement.

Bye
 
Prashant Langade
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The basic difference is

Statement is not compiled and PreparedStatement is pre-compiled.


Thanks and Regards
Prashant
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic