Bonjour,
Je developpe actuellement un programme de RH en java et je doit me connecter a une base de donnée Firebird reprenant tout les pointages de présence du personnel.
Malheureusement je n'arrive pas a établir la connection .
Si quelqu'un a une solution ou un lien à me proposer pour résoudre mon problème, je suis preneur .
La BD n'est pas installée sur mon PC, elle est sur le serveur (DCwin2000)
Voici le code :
Voici l'erreur :
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 import org.firebirdsql.*; import java.sql.*; public class Firebird { Connection connection=null; public Firebird() { try { Class.forName("org.firebirdsql.jdbc.FBDriver"); String url = "jdbc:firebirdsql:localhost:3050//Dcwin2000/e/BODET/OPEN/database/OPEN_DB.FDB"; String username = "user"; String password = "pswd"; connection = DriverManager.getConnection(url, username, password); System.out.println("Connection reussie"); } catch(ClassNotFoundException cnfe){cnfe.printStackTrace();} catch(SQLException sqle){sqle.printStackTrace();} } }
Merci d'avance pour vos réponses
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 org.firebirdsql.jdbc.FBSQLException: Resource Exception. Unable to complete network request to host "localhost". Reason: Unable to complete network request to host "localhost". at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:107) at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:275) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at Firebird.<init>(Firebird.java:15) at CL_ResHum.main(CL_ResHum.java:11) at org.firebirdsql.gds.GDSException: Unable to complete network request to host "localhost". at org.firebirdsql.jgds.GDS_Impl.connect(GDS_Impl.java:1602) at org.firebirdsql.jgds.GDS_Impl.isc_attach_database(GDS_Impl.java:276) at org.firebirdsql.jgds.GDS_Impl.isc_attach_database(GDS_Impl.java:252) at org.firebirdsql.jca.FBManagedConnectionFactory.createDbHandle(FBManagedConnectionFactory.java:543) at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.java:109) at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnection(FBManagedConnectionFactory.java:374) at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(FBStandAloneConnectionManager.java:61) at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:104) at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:275) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at Firebird.<init>(Firebird.java:15) at CL_ResHum.main(CL_ResHum.java:11)
PS : Si je me suis trompé d'endroit, je m'en excuse
Partager