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
How can I get information about foreign keys used in a table?
What is a jdbctemplate?
How we can you use preparedstatement.
What is new in JDBC 2.0?
What are the different types of classes in the api component?
How can we maintain the integrity of a database by using jdbc?
What do you mean by odbc?
How can you retrieve data from the resultset using jdbc?
Why do we need jdbc driver?
What is a datasource in java?
What is batch processing and how to perform batch processing in jdbc?
What is java soft framework?
Explain the steps in writing a java program using jdbc?
Can we have foreign key reference to a non primary key column ?
Write an sql to find all records having all upper case alphanumeric characters in a field ?