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
DB2 Universal claims to support JDBC 2.0, But I can only get JDBC 1.0 functionality. What can I do?
What does it mean to "materialize" data?
Expalin the method of calling a stored procedure from jdbc.
How many types of statements are there in jdbc?
What are the considerations for deciding on transaction boundaries?
What is represented by the connection object?
What is the meaning of connection?
What are the different classes through which JDBC represents statements?
What is JDBC Batch Processing and what are it’s benefits?
What is JDBC Savepoint? How to use it?
Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection?
Which package contains jdbc api?
What is the use of jdbc api?
How many packages are available in jdbc api?
What is preparedstatement in jdbc?