bonjour tout le monde, voila je developpe une application en ce moment et je veux tester ma connection a la base de données hsqldb sauf que j'obtient l'erreur suivante: org.hsqldb.jdbcdriver
voila ma classe connexion :
et comment je call dans ma class main:
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59 public class AddConnexion { private final String driver = Constantes.driver ; private final String url = Constantes.url ; private final String user = Constantes.user ; private final String passwd = Constantes.passwd ; protected Connection cnx; private String ERREUR = null; public String getERREUR() { return ERREUR ; } public AddConnexion() { try { Class.forName(this.driver); try { this.cnx = DriverManager.getConnection(this.url, this.user, this.passwd) ; this.ERREUR = null ; } catch(SQLException e) { this.ERREUR = e.getMessage(); } } catch(ClassNotFoundException e) { this.ERREUR = ("ERREUR DE CHARGEMENT")+e.getMessage(); } } protected void fermer() { try { Statement statement = this.cnx.createStatement(); statement.executeQuery("SHUTDOWN"); statement.close(); this.cnx.close(); this.ERREUR = null ; } catch(Exception e) { this.ERREUR = e.getMessage(); } } }
besoin d'aide SVP je call depuis plusieurs jours
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 AddConnexion cnx = null; cnx = new AddConnexion(); String teste = cnx.getERREUR(); actiontarget.setText(teste);
Partager