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

why Statment interface is not Deprecated.??

 
vitthal wable
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one please tell me that why Statement interface in java.sql package is not Deprecated as all fuctionality are provided with PreparedStatment?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34386
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vitthal,
There are still cases where someone would want to use Statement over PreparedStatement. For example, if you had no parameter substitution and knew the statement would only be executed once. In this case, a Statement would be more efficient.
 
Martin Simons
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just as a note, this is essentially the same advice I gave to his cross-posted question on the Java Intermediate forum.

@OP Please don't cross post. It is not considered polite in forum communities.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I closed the dupe.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic