JDBC-implementation of methods in INTERFACES
Hi
As I am quite new to JDBC.this might be a simple question but I think its quite enquiring.
We know that Connection,Statement,PrepareStatement ,Resultset are all interfaces but then how can we call method on them I mean:
Connection connection;
Statement stmt=connection.createStatement();
I want to know where are these method implemented ..
Please help
They're implemented in the driver--the jar file that you put in your classpath.
When you start with Connection con = DriverManager.getConnection();
you get an instance of a class that implements that interface. Other calls get you instances of classes that implement the other interfaces. You don't konw or care about the details of the classes--not even what their names are. All you care about is that they implement those interfaces.
jverda at 2007-7-15 16:58:44 >
