Connection issue in JayBird

Kishore picture Kishore · Sep 22, 2009 · Viewed 10.1k times · Source

I am new to Firebird using its Java version Jaybird, But unable to connect from database (.fdb file). The problem comes like this:

org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544375. unavailable database

OR

java.lang.RuntimeException: Failed to initilize Jaybird native library. This is most likley due to a failure to load the firebird client library.

Using following code:

Class.forName("org.firebirdsql.jdbc.FBDriver").newInstance();
connection = DriverManager.getConnection("jdbc:firebirdsql://localhost/3050:C:/XLNKREPOS /FIRBIRDXA.FDB", "SYSDBA", "masterkey");

Having following files in build path of Eclipse project:

  • jaybird-full-2.1.5.jar
  • jaybird21.dll
  • fbclient.dll
  • fbembed.dll

Also using the JVM arguments as -Djava.library.path="D:\Shared\Firebird\Jaybird-2.1.5JDK_1.5"

Tell me what is wrong in my approach?


Thanks RRUZ for giving repsonse.

Actually there was no space after "C:/XLNKREPOS" in my connection string, It was a copy past mistake. Again & again I got the following SQL Exception:

org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544375. unavailable database

And that database is no where used in other program.

Hope my this post makes you understand my problem.

Thanks

Answer

Mark picture Mark · Jan 7, 2010

The OP is mixing two jdbc url formats supported by Jaybird.

Either use

jdbc:firebirdsql://[host]{:[port]}/[path]

or

jdbc:firebirdsql:[host]{/[port]}:[path]

{...} used to indicate optional part