×
Home About Us Products Services News Free Scripts Contact
news php scripts and software

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


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

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: JAVA

 
<< Go back