Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to load JDBC drivers

Java: How to load JDBC drivers
{filelink=7101}

public class DriverJDBC
 {
  public static void main(String[] argv)
  	{
    try
    {
      Class a = Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");   // ODBC Driver
      System.out.println("loaded:  " + a.getName());
      Class b = Class.forName("oracle.jdbc.driver.OracleDriver");// Oracle Driver
      System.out.println("loaded:  " + b.getName());
      Class c = Class.forName("com.mysql.jdbc.Driver");          // MySQL Driver
      System.out.println("loaded:  " + c.getName());
      Class d = Class.forName("postgresql.Driver");              // Postgre Driver
      System.out.println("loaded:  " + d.getName()); 
    } catch (ClassNotFoundException ex)
    {
      System.err.println(ex);
    }
  }
}

Users who found this page were searching for:

  • sqljdbc 2013
  • BigDecimal negate examples
  • how to use underline in java swing
  • jpanel calender
  • program to encrypt string in python
  • python replace string in file from array
  • underline character in jbutton java
  • find number of days between two dates in perl
  • how to get inbox email messages with java
  • sun.net.ftp.ftpclient

No comments yet.

Leave a Comment