views:

346

answers:

4

Hi All;

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?

A: 

I think the problem must be the connection string, there is a blank space after "C:/XLNKREPOS"

Try this

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

Bye.

RRUZ
A: 

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

Kishore
A: 

Hi I had the same problem, it was caused by those slashes before localhost. That url should be : jdbc:firebirdsql:localhost/3050:C:/XLNKREPOS/FIRBIRDXA.FDB",

shpelda
A: 

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

Mark