1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
String driver = "oracle.jdbc.OracleDriver";
String url = "jdbc:oracle:thin:@oracle:1000:bd"; // l'url est correcte
String login = "login"
String password = "pass";
Connection connection = null;
try{
Class.forName(driver);
connection = DriverManager.getConnection(url,login,password);
}
catch(ClassNotFoundException cnfe){
System.out.println("Driver introuvable");
}
catch(SQLException sqle){
System.out.println("Erreur SQL");
}
catch(Exception e){
System.out.println("Autre erreur ");
} |
Partager