1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| public class Main21 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
Class.forName(org.postgresql.Driver);
System.out.println("Driver O.K.");
String url = "jdbc:postgresql://localhost:5432/Ecole";
String user = "postgres";
String passwd = "romaric";
Connection conn = DriverManager.getConnection(url, user, passwd);
System.out.println("Connexion effective !");
} catch (Exception e) {
e.printStackTrace();
}
}
} |
Partager