aspose file tools
The moose likes JDBC and Relational Databases 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 Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "why Statment interface is not Deprecated.??" Watch "why Statment interface is not Deprecated.??" New topic

why Statment interface is not Deprecated.??

vitthal wable

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
author & internet detective

Joined: May 26, 2003
Posts: 32299

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.

[OCA 8 book] [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

Joined: Mar 06, 2001
Posts: 13459

OK, I closed the dupe.
Consider Paul's rocket mass heater.
subject: why Statment interface is not Deprecated.??
jQuery in Action, 3rd edition