views:

127

answers:

2

Hi, I have installed Firebird 2.1 on windows Xp and using firebirdsql.jdbc-2.1.6 driver to connect with java. Code:

Class.forName("org.firebirdsql.jdbc.FBDriver"); 

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

I am getting 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.java:525) at 
java.sql.DriverManager.getConnection(DriverManager.java:171)

Please help.

Problem solved: Actually I had problem with jar file that I got from

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

I downloaded jaybird-full-2.1.6.jar from firebird offical website and problem got solved.

Correct URL is

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

I tried this URL earlier also but it was not working beacuse of jar issue.

A: 

Your URL is most likely broken for this driver.

Attach actual source to the jar and set a breakpoint in FBDataSource.getConnection(...) and see what values are actually present when the connection is attempted made.

Are you absolutely certain that the combination of a hostname with port agrees with a path to the FDB-file?

Thorbjørn Ravn Andersen
I am absolutley sure about connection parameters along with the path of FDB file.
A: 

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

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

Oops, I left in the leading slashes; try this:

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

Addendum: You might run through the common errors list. Also, my firebird database files end in .fdb, but the FAQ mentions .gdb. It can't hurt to check.

trashgod
I have tried all the options including url specified by you..nothing is working..
Is Firebird running on port 3050? Can you connect by any other means, e.g. isql or a GUI client?
trashgod
I can connect with isql and flameRobin..it is running on 3050 port..I have tried creating a new database..switching off windows firewall..copying dll's in system 32 (as specified on firebird support group)..
@rakesh-nitj: I corrected the URL above.
trashgod
@trashgod: Thanks for your response but still I am getting same exception..
@rakesh-nitj: Sorry, I'm running low on fresh ideas; more above.
trashgod
@trashgod:tried .gdb databases as well..anyways posted this question in firebird-java-support group..thanks for your time and efforts!
@rakesh-nitj: I'd like to hear how the problem gets resolved.
trashgod
@trashgod:Problem got solved. Please see the updates above. Thanks for your assistance.
@rakesh-nitj: Thanks for updating your question.
trashgod
@Thorbjørn Ravn Andersen: Sorry about misspelling your name. :-)
trashgod