Tuesday, November 29, 2011

How can we make objects of connection when connection is an interface.e.g. Connection conn = DriverManager.getConnection ????

Connection is used for getting a physical connection with database;:when our application executes connection con=DriverManager.getconnection(..);the internal code of getconnection()calls the connect method available in the driver class,the code in the driver class connects to the database,sends the username and pwd an object will be created based on a class that provides the implementation of connection interface:we never create a new Object of Connection interface, we just take a reference of that object.:interface Conn
Category:JDBC Interview Questions

No comments:

Post a Comment