|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have set up Firebird2.0 ,and then do operations as the doc in JayBird-2.0.1JDK_1.4,such as copy the .jars to /jbuilderx/lib,and config project library. my code is as follows: try { String databaseURL = "jdbc:firebirdsql:local:e:/a.fdb"; Class.forName("org.firebirdsql.jdbc.FBDriver"); String user = "sysdba"; String password = "masterkey"; try { conn = java.sql.DriverManager.getConnection(databaseURL, user, password); System.out.println("Connection established."); } catch (java.sql.SQLException e) { e.printStackTrace(); System.out.println( "Unable to establish a connection through the driver manager."); System.out.println("eeeeeeee" + e.toString()); return; } And the errors is: org.firebirdsql.gds.impl.jni.InternalError: FirebirdApiBinding::Initialize - Could not find or load the GDS32.DLL at org.firebirdsql.gds.impl.jni.JniGDSImpl.nativeInitilize(Native Method) at org.firebirdsql.gds.impl.jni.JniGDSImpl.attemptToLoadAClientLibraryFromList(JniGDSImpl.java:85) at org.firebirdsql.gds.impl.jni.LocalGDSImpl.<init>(LocalGDSImpl.java:29) at org.firebirdsql.gds.impl.jni.LocalGDSImpl.<init>(LocalGDSImpl.java:19) at org.firebirdsql.gds.impl.jni.LocalGDSFactoryPlugin.getGDS(LocalGDSFactoryPlugin.java:40) at org.firebirdsql.gds.impl.GDSFactory.getGDSForType(GDSFactory.java:219) at org.firebirdsql.jca.FBManagedConnectionFactory.getGDS(FBManagedConnectionFactory.java:110) at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:125) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at myservlet.testFireBird.connect(testFireBird.java:40) at myservlet.testFireBird.main(testFireBird.java:109) org.firebirdsql.gds.impl.jni.InternalError: FirebirdApiBinding::Initialize - Could not find or load the GDS32.DLL at org.firebirdsql.gds.impl.jni.JniGDSImpl.nativeInitilize(Native Method) at org.firebirdsql.gds.impl.jni.JniGDSImpl.attemptToLoadAClientLibraryFromList(JniGDSImpl.java:85) at org.firebirdsql.gds.impl.jni.LocalGDSImpl.<init>(LocalGDSImpl.java:29) at org.firebirdsql.gds.impl.jni.LocalGDSImpl.<init>(LocalGDSImpl.java:19) at org.firebirdsql.gds.impl.jni.LocalGDSFactoryPlugin.getGDS(LocalGDSFactoryPlugin.java:40) at org.firebirdsql.gds.impl.GDSFactory.getGDSForType(GDSFactory.java:219) at org.firebirdsql.jca.FBManagedConnectionFactory.getGDS(FBManagedConnectionFactory.java:110) at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:125) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at myservlet.testFireBird.connect(testFireBird.java:40) at myservlet.testFireBird.main(testFireBird.java:109) org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544344. I/O error for file %.0s"CreateFile (open)" null Error while trying to open file null Reason: I/O error for file %.0s"CreateFile (open)" null Error while trying to open file null at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122) at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at myservlet.testFireBird.connect(testFireBird.java:40) at myservlet.testFireBird.main(testFireBird.java:109) at org.firebirdsql.gds.GDSException: I/O error for file %.0s"CreateFile (open)" null Error while trying to open file null at org.firebirdsql.gds.impl.jni.JniGDSImpl.native_isc_attach_database(Native Method) at org.firebirdsql.gds.impl.jni.BaseGDSImpl.iscAttachDatabase(BaseGDSImpl.java:135) at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.java:89) at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnection(FBManagedConnectionFactory.ja va:470) at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(FBStandAloneConnectionManager.j ava:69) at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:119) at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at myservlet.testFireBird.connect(testFireBird.java:40) at myservlet.testFireBird.main(testFireBird.java:109) Unable to establish a connection through the driver manager. eeeeeeeeorg.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544344. I/O error for file %.0s"CreateFile (open)" null Error while trying to open file null Reason: I/O error for file %.0s"CreateFile (open)" null Error while trying to open file null It seems that the GDS32.DLL has been created by firebird set up program,I found it in C:\windows\system32.But why java could not find or load it? my os is winxp. jbuilderx,jdk1.4,firebird2.0,JayBird-2.0.1JDK_1.4. I have tried it with jbuilder9,the errors are the same. Could any one help me? |
|
#2
|
|||
|
|||
|
Quote:
Try: String databaseURL = "jdbc:firebirdsql:localhost:e:/a.fdb"; String databaseURL = "jdbc:firebirdsql:localhost/3050:E:/a.fdb"; String databaseURL = "jdbc:firebirdsql:127.0.0.1/3050:E:/a.fdb"; String databaseURL = "jdbc:firebirdsql:127.0.0.1:E:/a.fdb"; See if any of these work. Also: Try putting GDS32.DLL in the same directory as a.fdb. It could be a CLASSPATH issue. Clive. Last edited by clivew : December 11th, 2006 at 05:29 PM. |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > [help]java connect FireBird |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|