DriverManager: getDrivers() : DriverManager « java.sql « Java by API






DriverManager: getDrivers()

 


import java.sql.Driver;
import java.sql.DriverManager;

public class Main {
  public static void main(String[] args) throws Exception {
    Class driverClass = Class.forName("org.hsqldb.jdbcDriver");
    DriverManager.registerDriver((Driver) driverClass.newInstance());

    // Print out all loaded JDBC drivers.
    java.util.Enumeration e = java.sql.DriverManager.getDrivers();
    while (e.hasMoreElements()) {
      Object driverAsObject = e.nextElement();
      System.out.println("JDBC Driver=" + driverAsObject);
    }

  }
}

   
  








Related examples in the same category

1.DriverManager: getConnection(String url) (jdbc:odbc:technical_library)
2.DriverManager: getConnection(String url, String user, String password)
3.DriverManager: getConnection(String url, Properties info)
4.DriverManager: registerDriver(Driver driver)
5.DriverManager: setLogWriter(PrintWriter out)