Loading a JDBC Driver for MySQL - Java JDBC

Java examples for JDBC:MySQL

Description

Loading a JDBC Driver for MySQL

Demo Code


public class Main {
  public static void main(String[] argv) throws Exception {
    try {/*from  ww  w . j  a  v a 2  s  . co m*/
      // Load the JDBC driver
      String driverName = "org.gjt.mm.mysql.Driver";
      Class.forName(driverName);
    } catch (ClassNotFoundException e) {
    }
  }

}

Related Tutorials