Connection problem in JayBird

I am new to Firebird using its Java version of Jaybird but cannot connect from the database (.fdb file). The problem arises as follows:

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 the following code:

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

      

Having the following files in the build path of your Eclipse project:

  • Jaybird-complete 2.1.5.jar
  • jaybird21.dll
  • fbclient.dll
  • fbembed.dll

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

Tell me what is wrong with my approach?


Thanks to RRUZ for the answer.

There really was no space after "C: / XLNKREPOS" in my connection string. This was an error prior to the error. Over and over I got the following SQL Exception:

org.firebirdsql.jdbc.FBSQLException: GDS exception. 335544375. Inaccessible database

And this database is not used in another program.

Hope my post makes you understand my problem.

thank

+2


source to share


4 answers


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

Use

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

      



or

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

      

{...}

used to indicate an optional part

+3


source


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

try it



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

      

Bye.

+1


source


I had the same problem, it was caused by these forward slashes in front of the localhost. This URL should be:

jdbc:firebirdsql:localhost/3050:C:/XLNKREPOS/FIRBIRDXA.FDB",

      

+1


source


When I got this error it was because I was using the x64 version of Firebird instead of the standard x86 version. I figured that since I was running a 64 bit OS these embedded binaries matched me ... Hopefully this fixes your problem.

Troubleshooting Tips:

I was also able to further diagnose additional Firebird issues by adding the latest jar of log4j from apache site to my project / classpath. Then I added the log4j.properties file to the default / root src directory with the following properties set internally:

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%c{1},%p] %m%n
log4j.rootCategory=DEBUG, stdout
log4j.category.org.firebirdsql=DEBUG, stdout

      

I also had to install System.setProperty("FBLog4j", "true");

in my code.

Another thing you can do is make sure you are using the latest and greatest from your repository at http://firebird.cvs.sourceforge.net/viewvc/firebird/client-java/?view=tar

Just unpack the tarball and compile it using the script it provided (build.bat / build.sh). After compiling, look in the "output / lib" directory and you will find the most recent version of the jaybird jar (currently 2.2.0). You will also need the latest jaybird dll (as of now 22), which is in the native directory. I went through a lot of pain trying to figure this shit out. The documentation on the Firebird site is very outdated and poorly written.

+1


source







All Articles