Fri, 17 May 2024


How list all loaded JDBC drivers and gets information about each one?

By: Anton, NetArt Media
Sun, 15 November 2020

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();
}


Category: Web Development
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox