wood burning stoves 2.0*
The moose likes JDBC and the fly likes why Statment interface is not Deprecated.?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "why Statment interface is not Deprecated.??" Watch "why Statment interface is not Deprecated.??" New topic
Author

why Statment interface is not Deprecated.??

vitthal wable
Greenhorn

Joined: Sep 09, 2006
Posts: 16
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Martin Simons
Ranch Hand

Joined: Mar 02, 2006
Posts: 196
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

Joined: Mar 06, 2001
Posts: 13459

OK, I closed the dupe.
 
 
subject: why Statment interface is not Deprecated.??
 
Similar Threads
is singlethread model is thread safe?
Why Statemet interface is not Deprecated ?
Servlets
Single Thread Model
Extra Study