To test a JDBC driver installation using MySQL : JDBC Driver « Database « Java Tutorial






public class MainClass {
  public static void main(String[] args) {
    try {
      String className = "org.gjt.mm.mysql.Driver";
      Class driverObject = Class.forName(className);
      System.out.println("driverObject=" + driverObject);
      System.out.println("your installation of JDBC Driver OK.");
    } catch (Exception e) {
      System.out.println("Failed: JDBC Driver Error: " + e.getMessage());
    }

  }
}








20.1.JDBC Driver
20.1.1.What is JDBC?
20.1.2.What is a JDBC Driver?
20.1.3.Loading a JDBC Driver: Using Class.forName()
20.1.4.Using DriverManager.registerDriver()
20.1.5.To test a JDBC driver installation using Oracle
20.1.6.To test a JDBC driver installation using MySQL