Bonjour,
J'ai essayé avec ce code Java pour connecter avec une base de données postgresql.
Mais j'ai eu cette exception:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 import java.sql.Connection; import java.sql.DriverManager; public class Main { public static void main(String[] args) { try { Class.forName("org.postgresql.Driver"); System.out.println("Driver O.K."); String url = "jdbc:postgresql://localhost:8080/Ecole"; String user = "postgres"; String passwd = "postgres"; Connection conn = DriverManager.getConnection(url,user,passwd); System.out.println("Connexion effective !"); } catch (Exception e) { e.printStackTrace(); } } }
Comment je peux résoudre ce problème SVP?java.lang.ClassNotFoundException: org.postgresql.Driver
Partager