Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 11th, 2006, 01:14 AM
xth121 xth121 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 1 xth121 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 40 sec
Reputation Power: 0
Question [help]java connect FireBird

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?

Reply With Quote
  #2  
Old December 11th, 2006, 05:23 PM
clivew clivew is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 810 clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 5 h 46 m 49 sec
Reputation Power: 19
Quote:
Originally Posted by xth121

String databaseURL = "jdbc:firebirdsql:local:e:/a.fdb";


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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > [help]java connect FireBird


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT