You are quite right dear but still there are somethings which make me confuse. Some of them are the following
Connection con = DriverManager.getConnection
( "jdbc:myDriver:wombat", "myLogin","myPassword");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM Table1");
while (rs.next()) {
int x = rs.getInt("a");
String s = rs.getString("b");
float f = rs.getFloat("c");
}
Now in the above code talking about the first line, the DriverManager.getConnection() method returns a Connection object only, so how is it possible to call any method using that connection object.
Now there is one solution in my mind which i think may be the case, what i think is that may be in the getConnection method a Connection object gets created and that connection object is being assinged a refference of any class which implements Connection interface. After that this connection object is returned by the getConnection method.
Now please let me know if i am thinking right and please keep in mind that i m a newbee so please explain thoroughly.
Thanking you
Simrat Singh