Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: Comment charger les drivers de JDBC

mysql, sql, sql, mysql, oracle, odbc, jdbc, postgresql, java
{filelink=7101}

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

A Voir sur le même Sujet:

  • exemple application java base données codes sources
  • code source connexion base données java
  • comment on ajouter a la base oracle
  • Java
  • JDBC
  • MySQL
  • update jdbc java sur colonne auto_increment