Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4129
  • Last Modified:

JDBC JayBird Firebird connection failed

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
OTSSolutions
Asked:
OTSSolutions
  • 13
  • 13
1 Solution
 
ThlwareCommented:
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
 
OTSSolutionsAuthor Commented:
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
 
ThlwareCommented:
Can you post the form of your dbUrl as well
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
OTSSolutionsAuthor Commented:
dbUrl=jdbc:firebirdsql:192.168.1.22:C:\\Program Files\\2LS\\GRIP\\data\\grip.fdb?sql_dialect=1
0
 
ThlwareCommented:

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
 
OTSSolutionsAuthor Commented:
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
 
ThlwareCommented:
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
 
OTSSolutionsAuthor Commented:
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
 
ThlwareCommented:
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
 
OTSSolutionsAuthor Commented:
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
 
ThlwareCommented:
Your DB is running on port 3050 or 3080
0
 
OTSSolutionsAuthor Commented:
I tested on Both Ports, Both are Failed.
0
 
ThlwareCommented:
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
 
OTSSolutionsAuthor Commented:
Thanks for comments.


 Firebird Guardian Used. Its starttype is already automatic.

I want it to work locally and through network.


0
 
ThlwareCommented:
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
 
OTSSolutionsAuthor Commented:
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
 
ThlwareCommented:
Can you post your host file content ?
0
 
OTSSolutionsAuthor Commented:
dbUrl=jdbc:firebirdsql:localhost/3050:C:/Program Files/data/MYDB.fdb
userName=sysdba
password=masterkey
writeFlag=1
0
 
ThlwareCommented:
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
 
OTSSolutionsAuthor Commented:
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
 
ThlwareCommented:
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
 
OTSSolutionsAuthor Commented:
I tried 127.0.0.1/3050
Failed.
0
 
ThlwareCommented:
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
 
OTSSolutionsAuthor Commented:
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
 
OTSSolutionsAuthor Commented:
The Developer comments is fine. Didn't made the complete resolution to the issue.
0
 
ThlwareCommented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 13
  • 13
Tackle projects and never again get stuck behind a technical roadblock.
Join Now