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


Please Help Members By Posting Answers For Below Questions

Is jpa faster than jdbc?

503


How to get the Database server details in java program?

571


What is a jdbc url?

461


What is the use of statement in jdbc?

466


Write a program JDBCcode forfetching student database with SQL.

576






How can you know about drivers and database information ?

546


What is the JDBC syntax for using a literal or variable in a standard Statement?

559


Write an sql to find all records having all upper case alphanumeric characters in a field ?

527


What are the differences between setmaxrows(int) and setfetchsize(int)?

537


What is metadata in programming?

524


How many locking systems are there in jdbc?

554


List some new features available in jdbc 4.0?

477


Why do we use jdbc in java?

542


What is correlated subquery?

1741


What is the latest version of JDBC? What are the new features added in that?

520