Firebird java connection

I installed Firebird 2.1 on windows Xp and used the firebirdsql.jdbc-2.1.6 driver to connect to java. The code:

Class.forName("org.firebirdsql.jdbc.FBDriver"); connection = DriverManager.getConnection( "jdbc:firebirdsql://localhost/3050//C:/firebird/database/EMPLOYEE.FDB", "test","test"); 

I get the following error:

 Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception.  335544375.
 unavailable database 
 Reason: unavailable database at 
 org.firebirdsql.jdbc.FBDataSource.getConnection (FBDataSource.java:122) at 
 org.firebirdsql.jdbc.FBDriver.connect (FBDriver.java:140) at 
 java.sql.DriverManager.getConnection (DriverManager.javahaps25) at 
 java.sql.DriverManager.getConnection (DriverManager.java:171)

Please, help.

Problem solved: Actually, I had a problem with the jar file that I received from

http://mirrors.ibiblio.org/pub/mirrors/maven2

I downloaded jaybird-full-2.1.6.jar from the official firebird website and the problem was resolved.

Correct url

 "jdbc:firebirdsql://localhost:3050/C:\\firebird\\database\\EMPLOYEE.FDB" 

I tried this URL before but it did not work with jar problem.

+7
java jaybird firebird
source share
5 answers

As @ Thorbjørn Ravn Andersen notes, your Jaybird JDBC URL is incorrect. Syntax jdbc:firebirdsql:[host[/port]:]<database> . You need a colon between the host / port and the database. Maybe something like this:

 "jdbc:firebirdsql://localhost/3050:C:\\firebird\database\EMPLOYEE.FDB" 

Oh, I went into leading slashes; try the following:

 "jdbc:firebirdsql:localhost/3050:C:\\firebird\database\EMPLOYEE.FDB" 

Application: you can run the list of common errors . In addition, firebird database files end in .fdb , but .gdb is mentioned in the FAQ. This does not stop checking.

+1
source share

Your URL is likely to be corrupted for this driver.

Attach the actual source to the bank and set a breakpoint in FBDataSource.getConnection (...) and see what values ​​are actually present when trying to connect.

Are you absolutely sure that the combination of hostname and port matches the path to the FDB file?

0
source share

Looking at the documentation on this site: http://www.firebirdsql.org/file/documentation/drivers_documentation/java/faq.html , paragraph 3.1

It seems that after [port] you should have a slash "/" or a double slash "//" if you are connecting to a Linux server.

0
source share

From https://www.firebirdsql.org/file/documentation/drivers_documentation/java/faq.html#pure-java-default

Default URL format:

 "jdbc:firebirdsql://host[:port]/<database>" 

Deprecated but still deprecated URL format:

 "jdbc:firebirdsql:host[/port]:<database>" 

Then the correct URL should be:

 "jdbc:firebirdsql://localhost:3050/C:/firebird/database/EMPLOYEE.FDB" 
0
source share

To connect to a database located on a remote computer or in the cloud (linux), use the following link.

JDBC: firebirdsql: 34.212.208.251/3050:/opt/app/db/sample_training.fdb

0
source share

All Articles