1

I cloned a Java project in NetBeans 8.2 on Mac OS High Sierra that uses a Firebird database using jars jaybird-2.2.8.jar and jaybird-full-2-2-8.jar and it works well on computers with Windows 8.2 and 10, and Linux Ubuntu 16.04. The Firebird engine that I use in the development team is 2.5.8. and Java 1.8.

Using Firebird's default tool isql in the terminal works fine and Flamerobin also works, indicating that it is installed properly.

The error it throws in NetBeans, SquirreL SQL (Java), DBeaver (Java) is as follows:

Unexpected Error occurred attempting to open an SQL connection.
class org.firebirdsql.gds.impl.GDSServerVersionException: information type inappropriate for object specified
Version string "UI-V2.5.8.27089-1 Firebird 2.5DUI-V2.5.8.27089-1 Firebird 2.5/tcp (MacBook-Air-de-Ulises.local)/P10" does not match expected format
Expected engine version format: [platform]-[type][major version].[minor version].[variant].[build number] [server name]

Any idea what causes it?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • This might be a better fit for [dba.se]. – Dev-iL Jun 04 '18 at 06:25
  • @Dev-iL No it wouldn't, this is a programming related question. – Mark Rotteveel Jun 04 '18 at 09:06
  • @MarkRotteveel (before seeing your answer) it's difficult to tell one way or the other, since the OP goes to great length to describe why they think their system is set up correctly (which means they suspect it might not). OTOH, we don't really see any code related to accessing the DB, which might suggest that it is assumed to be correct (i.e. based on a published example). || Based on your answer, which shows in-depth familiarity with the library in question, it appears not to be "the fault of the user" but after all - a faulty setup. Does that qualify for [dba.se]? Maybe... – Dev-iL Jun 04 '18 at 09:44
  • @Dev-iL It is not a faulty setup, it is a bug in the JDBC driver the OP is using, which makes it a programming problem. – Mark Rotteveel Jun 04 '18 at 09:50

1 Answers1

2

The version number reported by your Firebird installation does not match the format expected by Jaybird. The problem is the -1 in UI-V2.5.8.27089-1.

Firebird will normally report something like UI-V2.5.8.27089 ..., but the build for MacOS needed to be rebuilt due to issues with the initial build. This created a revision 1, and Jaybird does not expect that revision to be included in the version number string.

You have the following workarounds:

  1. Install a Firebird version that does not have a -1 revision

  2. Patch org.firebirdsql.gds.impl.GDSServerVersion and replace it in your Jaybird jar. The change you need to make is replacing

     private static final Pattern VERSION_PATTERN = 
         Pattern.compile("((\\w{2})-(\\w)(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)) ([^-,]+)(?:[-,](.*))?");
    

    with

     private static final Pattern VERSION_PATTERN = 
         Pattern.compile("((\\w{2})-(\\w)(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)(?:-\\S+)?) ([^-,]+)(?:[-,](.*))?");
    

I have created issue JDBC-534 for this.

This has been fixed in Jaybird 3.0.5 and 2.2.15, which is available from the Firebird JDBC driver download page.

Given you were using a relatively old version of Jaybird 2.2, I do suggest you take a look at the release notes to see all changes and fixes since version 2.2.8.

Disclaimer: I maintain Jaybird.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197