How do you know which driver is connected to a database?

Answer Posted / nadia

// By the help of DatabaseMetadata it gives all the
information about the date base for which our progrim is
connected
// here it goes

1.Class.forName("DriverClass name");
2.Connection con =DriverManager.getConection("URL Of
Manager Class");
DatabaseMetadata dmeta= con.getMetadata();
// by calling the method getDriverName() name we can
able to know that which driver is coonected to the database.
3. System.out.println(" driver name " +
dmeta.getDriverName());

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how data flows from view to db and reverse

1724


How do I load a database driver with JDBC 4.0 / Java 6?

644


How do I find ojdbc jar version?

581


Explain the locking system in jdbc?

620


How many jdbc driver types are there?

554






What do you mean by two phase commits?

643


Name the method, which is used to prepare a callablestatement.

579


How do I stop nullpointerexception?

589


What is metadata in java programming?

564


What is jdbc oracle thin?

552


What is DML?

649


How can I determine the isolation levels supported by my DBMS?

601


Is not bound in this context unable to find jdbc spring boot?

565


How to set NULL values in JDBC PreparedStatement?

621


What is jndi lookup?

604