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
What are devices?
What are the methods which can verify the cursor particular position?
What does adapter class provide?
Is odbc an api?
Is jdbctemplate thread safe?
How can we set null value in jdbc preparedstatement?
Explain the locking system in jdbc & its types?
What is the advantage of namedparameterjdbctemplate?
What is setautocommit in jdbc?
What are 4 drivers available in JDBC? At what situation are four of the drivers used?
What is batch processing and how to perform batch processing in jdbc?
How can I know when I reach the last record in a table, since JDBC doesn't provide an EOF method?
How will you perform truncation using JDBC?
What is ODBC and JDBC? How do you connect the Database?
What is jdbc connection?