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
How to rollback a JDBC transaction?
What are the different types of statements in jdbc?
Give an example for getXXX method?
Can we have foreign key reference to a non primary key column ?
What are the conditions applies to varchar variable, when using in procedures?
Can resultset be null in java?
Why we use jdbc instead of odbc?
What is the JDBC?
Can I set up a connection pool with multiple user IDs? The single ID we are forced to use causes problems when debugging the DBMS.
What is database connection pooling? Advantages of using a connection pool?
Write an sql to find all records having all upper case alphanumeric characters in a field ?
What does the jdbc driver interface do?
Does the database server have to be running Java or have Java support in order for my remote JDBC client app to access the database?
How do I find whether a parameter exists in the request object?
What is the jdbc rowset?