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
Is jpa faster than jdbc?
How to get the Database server details in java program?
What is a jdbc url?
What is the use of statement in jdbc?
Write a program JDBCcode forfetching student database with SQL.
How can you know about drivers and database information ?
What is the JDBC syntax for using a literal or variable in a standard Statement?
Write an sql to find all records having all upper case alphanumeric characters in a field ?
What are the differences between setmaxrows(int) and setfetchsize(int)?
What is metadata in programming?
How many locking systems are there in jdbc?
List some new features available in jdbc 4.0?
Why do we use jdbc in java?
What is correlated subquery?
What is the latest version of JDBC? What are the new features added in that?