Java examples for JDBC:Driver
Listing All Loaded JDBC Drivers
import java.sql.Driver; import java.sql.DriverManager; import java.util.Collections; import java.util.List; public class Main { public static void main(String[] args) { 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(); }/*from w ww.j a va2 s . co m*/ } }