How do you know which driver is connected to a database?
Answer Posted / ramakant
// 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");
DatabaseMetada 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 ? | 8 Yes | 1 No |
Post New Answer View All Answers
Where is jdbc url mysql?
What are the different types of statements in jdbc?
How do I check in my code whether a maximum limit of database connections have been reached?
What is the latest version of JDBC? What are the new features added in that?
How to insert an image or raw data into database?
What does connection pooling mean ?
When do we use execute method in java jdbc?
Define preparedstatement.
What is jdbc driver manager?
Why “no suitable driver” error occurs?
How to set the attribute concurrency in resultset?
What is jdbc architecture in java?
What is the use of setFetchSize() and setMaxRows() methods in Statement?
How do you determine the sensitivity of the ResultSet object?
What is jdbc stand for?