Listing All Loaded JDBC Drivers

This example lists all loaded JDBC drivers and gets information about each one.
List drivers = Collections.list(DriverManager.getDrivers()); for (int i=0; i<drivers.size(); i++) { Driver driver = (Driver)drivers.get(i); // Get name of driver String name = driver.getClass().getName(); // Get version info int majorVersion = driver.getMajorVersion(); int minorVersion = driver.getMinorVersion(); boolean isJdbcCompliant = driver.jdbcCompliant(); }

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.