*
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
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: 29245
    
139

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why Statment interface is not Deprecated.??
 
Similar Threads
Extra Study
is singlethread model is thread safe?
Servlets
Why Statemet interface is not Deprecated ?
Single Thread Model