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
What is database connection pooling? Advantages of using a connection pool?
How to check jdbc connection in java?
How can I know when I reach the last record in a table, since JDBC doesn't provide an EOF method?
What is the use of callablestatement? Name the method, which is used to prepare a callablestatement.
What is layer in communication?
How to move the cursor in scrollable resultset ?
What is connection data?
What is jdbc architecture?
What is the purpose of jdbc resultset interface?
What is the advantage of namedparameterjdbctemplate?
What is jdbc url for mysql?
What are dml and ddl?
How does a custom RowSetReader get called from a CachedRowSet?
Explain the difference between resultset and rowset in jdbc
Why is jdbc used?