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
  • program to encrypt string in python
  • accessing password protected folder from java
  • how to get inbox email messages with java
  • read email with python
  • javamail yahoo example
  • find number of days between two dates in perl
  • jpanel calender
  • how to read gmail inbox using ja
  • BigDecimal negate examples

No comments yet.

Leave a Comment