Solved

JDBC JayBird Firebird connection failed

Posted on 2010-11-22
26
3,485 Views
Last Modified: 2012-05-10
Hi,

I am facing an issue. I am using JDBC for connecting to firebird DB.
in some PCs works fine and some failed.  I am getting the following error.

org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544583. SQLDA missing or
incorrect version, or incorrect number/type of variables

The above exception getting when I am trying to connect.

If I reinstalls the firebird, works fine. if I restarts the Pc, again fails to connect.( this is not on all Pcs.)


Thanks and Regards,
VIJESH V.NAIR
0
Comment
Question by:OTSSolutions
  • 13
  • 13
26 Comments
 
LVL 2

Expert Comment

by:Thlware
ID: 34194486
Are you trying to connect to InterBase  ?
What is your daba server and version ?
what is the version of your jaybird?
Post the code snipped where you trying to connect
0
 

Author Comment

by:OTSSolutions
ID: 34194509
HI
Thanks Thlware,

Answers as follows.

I am connecting to Firebird 2.1.
I am using jaybird-full-2.1.6.jar

Code Snippet as follows. Please note I am using a property file.


Thanks and Regards
VIJESH V.NAIR

dbUrl = new DbConnection().backlashReplace(pro.getProperty("dbUrl"));

 userName = pro.getProperty("userName");

password = pro.getProperty("password");





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

driver  =  java.sql.DriverManager.getDriver(dbUrl);

conn = DriverManager.getConnection(dbUrl,userName,password);

Open in new window

0
 
LVL 2

Expert Comment

by:Thlware
ID: 34194579
Can you post the form of your dbUrl as well
0
 

Author Comment

by:OTSSolutions
ID: 34195368
dbUrl=jdbc:firebirdsql:192.168.1.22:C:\\Program Files\\2LS\\GRIP\\data\\grip.fdb?sql_dialect=1
0
 
LVL 2

Accepted Solution

by:
Thlware earned 250 total points
ID: 34195629

try

dbUrl=jdbc:firebirdsql:192.168.1.22/port:C:/Program Files/2LS/GRIP/data/grip.fdb?sql_dialect=1

default port = 3050 (use different port if you are on different port)

dbUrl=jdbc:firebirdsql:192.168.1.22/3050:C:/Program Files/2LS/GRIP/data/grip.fdb?sql_dialect=1

Open in new window





and please provide full stack trace

0
 

Author Comment

by:OTSSolutions
ID: 34196493
I tried. but failed.

org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544344. I/O error for fil

e CreateFile (open) "C:/Program Files/2LS/GRIP/data/grip"

Error while trying to open file

null

Reason: I/O error for file CreateFile (open) "C:/Program Files/2LS/GRIP/data/gri

p"

Error while trying to open file

null

        at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122

)

        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)

        at java.sql.DriverManager.getConnection(DriverManager.java:582)

        at java.sql.DriverManager.getConnection(DriverManager.java:185)

        at com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)

        at com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)

        at com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)

at org.firebirdsql.gds.GDSException: I/O error for file CreateFile (open) "C:/Pr

ogram Files/2LS/GRIP/data/grip"

Error while trying to open file

null

        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(Ab

stractJavaGDSImpl.java:2169)

        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(Abs

tractJavaGDSImpl.java:2119)

        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.internalAttachDatab

ase(AbstractJavaGDSImpl.java:434)

        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase(A

bstractJavaGDSImpl.java:369)

        at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.ja

va:86)

        at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnectio

n(FBManagedConnectionFactory.java:477)

        at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(

FBStandAloneConnectionManager.java:69)

        at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:119

)

        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)

        at java.sql.DriverManager.getConnection(DriverManager.java:582)

        at java.sql.DriverManager.getConnection(DriverManager.java:185)

        at com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)

        at com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)

        at com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)

Nov 23, 2010 7:05:57 PM com._2LS.seevee.DbConnection getConnection

INFO: org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122)

org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)

java.sql.DriverManager.getConnection(DriverManager.java:582)

java.sql.DriverManager.getConnection(DriverManager.java:185)

com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)

com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)

com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)



Nov 23, 2010 7:05:57 PM com._2LS.seevee.SearchCVFiles Search

INFO:  indexpath : C:\Program Files\2LS\GRIP\spool\ndx

Searching for: contents:sql

Nov 23, 2010 7:05:57 PM com._2LS.seevee.SearchCVFiles Search

INFO: com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:103)

com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)



Nov 23, 2010 7:05:57 PM com._2LS.seevee.SearchCVFiles Search

INFO: Connection closed

message===>successindexpath:C:\Program Files\2LS\GRIP\spool\ndx

   4 total matching documents

Exception:java.lang.NullPointerException

Connection closed

Open in new window

0
 
LVL 2

Expert Comment

by:Thlware
ID: 34196589
I think you getting somewhere cause I see the error is different

check on your url if you have put  the ext  .fdb

then check if file is in the exact file structure

C:/Program Files/2LS/GRIP/data/grip.fdb

0
 

Author Comment

by:OTSSolutions
ID: 34196711
Thanks.
I checked the path. C:/Program Files/2LS/GRIP/data/grip.fdb is exists.

I am attaching the log when tried to
bUrl=jdbc:firebirdsql:192.168.1.22/3080:C:/Program Files/2LS/GRIP/data/grip.fdb?sql_dialect=3

Log attached
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544583. SQLDA missing or

incorrect version, or incorrect number/type of variables

Reason: SQLDA missing or incorrect version, or incorrect number/type of variable

s

        at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122

)

        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)

        at java.sql.DriverManager.getConnection(DriverManager.java:582)

        at java.sql.DriverManager.getConnection(DriverManager.java:185)

        at com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)

        at com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)

        at com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)

at org.firebirdsql.gds.GDSException: SQLDA missing or incorrect version, or inco

rrect number/type of variables

        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.parseAttachDatabase

Info(AbstractJavaGDSImpl.java:624)

        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.internalAttachDatab

ase(AbstractJavaGDSImpl.java:441)

        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase(A

bstractJavaGDSImpl.java:369)

        at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.ja

va:86)

        at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnectio

n(FBManagedConnectionFactory.java:477)

        at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(

FBStandAloneConnectionManager.java:69)

        at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:119

)

        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)

        at java.sql.DriverManager.getConnection(DriverManager.java:582)

        at java.sql.DriverManager.getConnection(DriverManager.java:185)

        at com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)

        at com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)

        at com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)

Nov 23, 2010 7:49:57 PM com._2LS.seevee.DbConnection getConnection

INFO: org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122)

org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)

java.sql.DriverManager.getConnection(DriverManager.java:582)

java.sql.DriverManager.getConnection(DriverManager.java:185)

com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)

com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)

com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)



Nov 23, 2010 7:49:57 PM com._2LS.seevee.SearchCVFiles Search

INFO:  indexpath : C:\Program Files\2LS\GRIP\spool\ndx

Searching for: contents:sql

Nov 23, 2010 7:49:58 PM com._2LS.seevee.SearchCVFiles Search

INFO: com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:103)

com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)



Nov 23, 2010 7:49:58 PM com._2LS.seevee.SearchCVFiles Search

INFO: Connection closed

message===>successindexpath:C:\Program Files\2LS\GRIP\spool\ndx

   4 total matching documents

Exception:java.lang.NullPointerException

Connection closed

Open in new window

0
 
LVL 2

Expert Comment

by:Thlware
ID: 34196738
note // after  jdbc:firebirdsql:
should work if your file exist and check access right on the folder and file

dbUrl=jdbc:firebirdsql://192.168.1.22/3050:C:/Program Files/2LS/GRIP/data/grip.fdb?sql_dialect=1

Open in new window

0
 

Author Comment

by:OTSSolutions
ID: 34197141
I tried, again failed.
log attached
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544721. Unable to complet

e network request to host "3050".

Failed to locate host machine.

The specified name was not found in the hosts file or Domain Name Services.

Reason: Unable to complete network request to host "3050".

Failed to locate host machine.

The specified name was not found in the hosts file or Domain Name Services.

        at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122

)

        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)

        at java.sql.DriverManager.getConnection(DriverManager.java:582)

        at java.sql.DriverManager.getConnection(DriverManager.java:185)

        at com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)

        at com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)

        at com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)

at org.firebirdsql.gds.GDSException: Unable to complete network request to host

"3050".

Failed to locate host machine.

The specified name was not found in the hosts file or Domain Name Services.

        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(Ab

stractJavaGDSImpl.java:2169)

        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(Abs

tractJavaGDSImpl.java:2119)

        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.internalAttachDatab

ase(AbstractJavaGDSImpl.java:434)

        at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase(A

bstractJavaGDSImpl.java:369)

        at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.ja

va:86)

        at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnectio

n(FBManagedConnectionFactory.java:477)

        at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(

FBStandAloneConnectionManager.java:69)

        at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:119

)

        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)

        at java.sql.DriverManager.getConnection(DriverManager.java:582)

        at java.sql.DriverManager.getConnection(DriverManager.java:185)

        at com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)

        at com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)

        at com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)

Nov 23, 2010 8:41:35 PM com._2LS.seevee.DbConnection getConnection

INFO: org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122)

org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)

java.sql.DriverManager.getConnection(DriverManager.java:582)

java.sql.DriverManager.getConnection(DriverManager.java:185)

com._2LS.seevee.DbConnection.getConnection(DbConnection.java:102)

com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:75)

com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)



Nov 23, 2010 8:41:35 PM com._2LS.seevee.SearchCVFiles Search

INFO:  indexpath : C:/Program Files/2LS/GRIP/spool/ndx

Searching for: contents:sql

Nov 23, 2010 8:41:36 PM com._2LS.seevee.SearchCVFiles Search

INFO: com._2LS.seevee.SearchCVFiles.Search(SearchCVFiles.java:103)

com._2LS.seevee.SearchCVFiles.main(SearchCVFiles.java:144)

Open in new window

0
 
LVL 2

Expert Comment

by:Thlware
ID: 34202761
Your DB is running on port 3050 or 3080
0
 

Author Comment

by:OTSSolutions
ID: 34202844
I tested on Both Ports, Both are Failed.
0
 
LVL 2

Expert Comment

by:Thlware
ID: 34202865
you  said
if I restarts the Pc, again fails to connect
Can you check if your firebird service is set to start automatically when you restart your machine

Open Control Panel -> Services (NT) or Control Panel -> Administrative Tools -> Services (2000, XP)

Is this a remote machine ? if yes can you ping the ip if not try use localhost

0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:OTSSolutions
ID: 34203069
Thanks for comments.


 Firebird Guardian Used. Its starttype is already automatic.

I want it to work locally and through network.


0
 
LVL 2

Expert Comment

by:Thlware
ID: 34203150
But before making it work on the network is it working locally ?
Is that IP same machine where the code is.
Can we troubleshoot locally first then once we got it right try over network.

Do you have that IP  defined in your host file ?
0
 

Author Comment

by:OTSSolutions
ID: 34203190
But before making it work on the network is it working locally ?
  NO
Is that IP same machine where the code is.
  yes
Do you have that IP  defined in your host file ?
 yes
0
 
LVL 2

Expert Comment

by:Thlware
ID: 34203257
Can you post your host file content ?
0
 

Author Comment

by:OTSSolutions
ID: 34203277
dbUrl=jdbc:firebirdsql:localhost/3050:C:/Program Files/data/MYDB.fdb
userName=sysdba
password=masterkey
writeFlag=1
0
 
LVL 2

Expert Comment

by:Thlware
ID: 34203297
No not your properties file but hosts file    (you can block out you ips)

C:\WINDOWS\system32\drivers\etc\hosts

if not in that directory search it in


C:\WINDOWS\


 
0
 

Author Comment

by:OTSSolutions
ID: 34203985
Sorry,
I am attaching

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
127.0.0.1         localhost
127.0.0.1         mpa.one.microsoft.com     #for XP/2003/2007
127.0.0.1         sls.microsoft.com             #for Vista
127.0.0.1         genuine.microsoft.com
0
 
LVL 2

Expert Comment

by:Thlware
ID: 34204023
The ip you trying to use on dbUrl is not in this file.
Can you try your connection using the local host ip 127.0.0.1
0
 

Author Comment

by:OTSSolutions
ID: 34204276
I tried 127.0.0.1/3050
Failed.
0
 
LVL 2

Expert Comment

by:Thlware
ID: 34204353
Can you send me your code one java file that makes connection and included libraries jaybird and related libs
 (Not db will use my own)
0
 

Author Comment

by:OTSSolutions
ID: 34215546
Thanks ThlWare,
 I resolved it. I had interbase installed in the PC. This made some mismatch with jdbc driver. When I uninstalled Interbase, its Working Well.

Thank you for giving the attention to this Question.

Thanks and Regards,
VIjesh V.Nair
0
 

Author Closing Comment

by:OTSSolutions
ID: 34215550
The Developer comments is fine. Didn't made the complete resolution to the issue.
0
 
LVL 2

Expert Comment

by:Thlware
ID: 34215682
Hi OTSSolutions glad you got resolution.
Funny I was reading our troubleshooting conversations and you seem to have missed the first question on my first comment
 
Are you trying to connect to InterBase  ?
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article describes some very basic things about SQL Server filegroups.
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now