This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JDBC and the fly likes Statement, an interface ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Statement, an interface ?" Watch "Statement, an interface ?" New topic
Author

Statement, an interface ?

Vilas Lawande
Ranch Hand

Joined: Nov 07, 2006
Posts: 127
Statement stmt =con.createStatement();

As Statement is an interface,How object is created for Statement ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42374
    
  64
The same way it is created for all other interfaces: a class that implements that interface is instantiated. You can find out which one that is by calling stmt.getClass().getName().


Ping & DNS - my free Android networking tools app
Vilas Lawande
Ranch Hand

Joined: Nov 07, 2006
Posts: 127
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Statement, an interface ?