L3 Info : SGBD
 
◃  Ch. 13 JDBC  ▹
 

Connexion à la base

  • Utilisation de la méthode Connection getConnection(String url, String user, String password) throws SQLException de DriverManager
  • Le DriverManager essaie tous les drivers enregistrés (chargés en mémoire avec Class.forName()) jusqu'à ce qu'il trouve un driver qui lui fournisse une connexion
  • Connection connexion = DriverManager.getConnection(url, toto, password);