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 not bound in this context unable to find jdbc spring boot?
What does connection pooling mean ?
How we store procedure in oralce for callable statements in jdbc
What is JDBC Batch Processing and what are it’s benefits?
What is jdbc and jdbc drivers?
How to achieve JDBC Connection Pooling using JDBC DataSource and JNDI in Apache Tomcat Server?
What is odbc and jdbc?
Explain how data flows from view to db and reverse
Why prepared statements are faster?
What is odbc jdbc?
What are the different types of drivers under jdbc?
What is the meaning of connection?
Does jdbctemplate close connection?
Explain some new features available in jdbc 4.0?
What are the common tasks of JDBC?