How to create Connection interface object because it is
Interface , Interface is not instansiated?
Answer Posted / anand
We can not create object to any interface but we can create a reference variable to interface. Connection is an interface released by SUN micro system.Once interface released anybody in this world can provide implementation,provide implementation means writing down the code for all the methods of that inteface. As we know that Connection is an interface relased by sun micro system and Oracle corporation provide implementation class to that inteface and this class is called "Connetion class".We can create the reference variable to Connection interface and this reference variable hold the object of class which provide the implementation to Connection class.
DriverManager is also an interface and this interface contains a static method getConnection(), this method returns the object of a class which provide implementation of Connection interface.
| Is This Answer Correct ? | 0 Yes | 7 No |
Post New Answer View All Answers
What is jdbc driver for sql server?
What do you understand by jdbc datasource?
What is a java driver?
How to retrieve warnings in jdbc?
What is represented by the connection object?
What is database deadlock ? How can we avoid them?
What do you understand by DDL and DML statements?
What is jdbc in java?
How many rowset are available in jdbc?
How can you make a connection?
What class.forname does, while loading the drivers?
What does jdbc do?
How do I connect to jdbc?
State the three different ways in which you can create a table?
what is the meaning of following code snippets Class c=class.forName(driverClassName); Driver d=(driver)c.newInstance();