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

What are common JDBC Exceptions?

709


Name different methods for getting streams.

712


How can we set null value in jdbc preparedstatement?

702


What does the jdbc connection interface?

699


What is an odbc driver?

661






What is a jdbc connection string?

613


What are the common jdbc exceptions?

682


What is while rs next ())?

685


How do you insert images into database using jdbc?

766


What types of DataSource objects are specified in the Optional Package?

726


Explain about the Try Block?

714


Describe how the jdbc application works.

696


What do you mean by batch processing in jdbc?

730


What is difference between statement and preparedstatement in jdbc?

646


What is the different between ResultSet and RowSet?

699