Jaybird 5.0.6 released

16 October 2024

We are happy to announce the release of Jaybird 5.0.6.

The following has been fixed since Jaybird 5.0.5:

  • Fixed: Exceptions during statement execution did not always complete the statement, which could delay transaction commit in auto-commit mode (#806)

  • Fixed: Closing a connection when the database was shutdown, or the connection was otherwise broken, could result in a NullPointerException (#812)

  • Fixed: Error “Column unknown; IND.RDB$CONDITION_SOURCE” when calling DatabaseMetaData.getIndexInfo on Firebird 5.0 with a Firebird 4.0 (ODS 13.0) database (#813)

  • Fixed: Calling ResultSet.wasNull() when on the insert-row throws a SQLException instead of reporting the null-state of the last retrieved column (#816)

  • Fixed: Inserting a row into a result set backed by a server-side scrollable cursor could include the inserted row twice (#819)

  • Improvement: Updated JNA dependency to version 5.15.0 (#823)

Jaybird 5 supports Firebird 2.5 and higher, on Java 8, 11, 17, 21, and 23 (support for Java 11 and higher using the Java 11 version of the driver).

See also:

Jaybird 5.0.5 released

14 June 2024

We are happy to announce the release of Jaybird 5.0.5.

The following has been fixed since Jaybird 5.0.4:

  • Fixed: FBResultSetMetaData.getPrecision would always estimate the precision of NUMERIC or DECIMAL columns instead of obtaining the actual precision if the column position was 71 or higher (#731)

  • Optimized the query to retrieve extended field info for ResultSetMetaData.getPrecision to only retrieve columns of type NUMERIC or DECIMAL (#732)

  • Fixed: PreparedStatement.executeBatch() of statement without parameters throws “Statement used in batch must have parameters [SQLState:07001, ISC error code:335545186]” on Firebird 4.0 or higher (#788)

  • New feature: ResultSetMetaData.isAutoIncrement(int) reports true for identity columns if Jaybird can identify the underlying table and column (#793)

  • New feature: Boolean connection property extendedMetadata (default true) to disable querying of extended metadata for getPrecision(int) and isAutoIncrement(int) of ResultSetMetaData (#795)

  • Improvement: The FILTER_CONDITION of DatabaseMetaData.getIndexInfo is populated for Firebird 5.0 partial indices (#797)

  • Fixed: ResultSet.isBeforeFirst() and ResultSet.isAfterLast() should always report false for an empty result set (#807)

  • Improvement: Statement.getResultSet no longer throws a SQLException with message “Only one result set at a time/statement” if the current result set has already been returned by executeQuery or a previous call to getResultSet (#762)

  • Improvement: Updated JNA dependency to version 5.14.0 (#810)

Jaybird 5 supports Firebird 2.5 and higher, on Java 8, 11, 17, 21, and 22 (support for Java 11 and higher using the Java 11 version of the driver).

See also:

Installing Firebird 3 on Xubuntu

05 April 2024

A recent question on firebird-support about using Firebird on Xubuntu, and the problems the asker ran into, lead me to trying it out myself. This post is basically a collection of the steps I took to get Firebird up and running on Xubuntu.

I’m usually a Windows user, and although I have collected some Linux knowledge over the years, I’m far from an expert. In other words, this might not be the optimal to do things.

Preparing the VM

To start, I’m installing Xubuntu as a Hyper-V virtual machine, as it’s included in my Windows 11 Pro installation. If you don’t have Hyper-V, you might be able to use something like Virtual Box.

I downloaded the Xubuntu 23.10 (Mantic Minotaur) desktop ISO image through https://xubuntu.org/download/#non-lts.

In the Hyper-V Manager, I created a new VM using the "Quick Create" option:

  • Select the “Local installation source” option and browse to and select the ISO image.

  • Uncheck the “This machine will run Windows (enables Windows Secure Boot)” option

  • Optionally, click on “More options” and set the name and network for the VM (I used the name “Xubuntu 23.10”)

    Screenshot of the Hyper-V Quick Create screen showing the options entered as described above
  • Click “Create Virtual Machine” to start the VM and start the installation process

  • Wait for Hyper-V to initialize the VM, and then click on “Connect”

  • Hyper-V displays a message that the virtual machine is turned off, click on “start”

  • A Grub (Linux boot loader) window is shown, select the “Try or install Xubuntu” option, or wait for it to start automatically

Installing Xubuntu

Now, the Xubuntu installer allows you to select your language, and either “Try Xubuntu” or “Install Xubuntu”.

  • Select “Install Xubuntu”

  • Choose your keyboard layout, and click “Continue”

  • On the “Updates and other software” screen, leave the defaults as is, and click “Continue”

  • On the “Installation type” screens, choose the appropriate option for your installation. Given we’re installing a VM, which has its own virtual harddrive, the standard option “Erase disk and install Xubuntu” is good, and click “Install now”

  • On the “Write the changes to disks” confirm the change by clicking “Continue”

  • On the “Where are you?” screen select your location (this is for the timezone configuration), and click “Continue”

  • On the “Who are you?” screen enter the requested information, and click “Continue”

The installation will now install Xubuntu in the VM. This can take a while depending on your machine and internet speed.

After a while, the “Installation Complete” popup will show

  • Click “Restart Now”, and wait for Xubuntu to start up.

  • When the VM has restarted, enter the password you set previously to login

Installing Firebird

Now we’re ready to install Firebird.

As I said before, I’m normally a Windows user, so maybe some steps taken are not the optimal way to do things.

We’re going to install Firebird from the terminal.

  • To start a terminal, press Alt+F2 which will popup the “Application Finder”

  • Type “term” and select the “xfce4-terminal”, and click “Launch”

Although the latest Firebird version is Firebird 5.0.0, Xubuntu comes with Firebird 3.0.11, through the Ubuntu and ultimately the Debian projects. It is also possible to install Firebird using the installer from the Firebird site, but for this blog, I’m using the package provided by Xubuntu.

Although the terminal is textual, I will show screenshots of terminal output. That is because I’m writing this blog on Windows, and — at least by default — you can’t share the clipboard between the Hyper-V VM and the host, and I’m too lazy to find out if this can be changed or to use an alternative like exchanging files between the VM and the host.

In some cases I do provide textual output, but there I have transcribed the output (possibly with typos), or — for isql output — retried it on Windows and copied and modified the output to match the output in the VM.

First, I’m going to show how you can find what — if any — Firebird packages are available. This might help you if you’re using a future Xubuntu version, which for example might provide Firebird 4.0 or Firebird 5.0 instead of Firebird 3.0

  • To find packages, you can use apt search. To look for packages with “firebird” in their name or description, enter apt search firebird:

    Output of 'apt search firebird'

    It lists multiple packages, but the ones we’re interested in are the packages starting with “firebird3.0”, and primarily the “firebird3.0-server” package. Some of the other packages, like for example “flamerobin”[1] might also be of interest to you.

  • To install a package, you use apt install, but installation requires super user privileges (comparable to Windows Administrator privilege/UAC), so you need to run it with sudo (which means as much as “do as super user”).

    Run sudo apt install firebird3.0-server, and when prompted enter your password (the user created by the installer is allowed to elevate its privileges to a super user).

  • apt will show which packages it will install in addition to firebird3.0-server. Confirm with Enter or enter Y followed by Enter

  • The installer will prompt for a password for the SYSDBA user (the main administrator account for Firebird).

    For purposes of this blog, I’m using the well-known password “masterkey”, but for a real installation, please use a strong password.

    You can also let the installer generate a random password for you by leaving the password empty. You can find this password in the /etc/firebird/3.0/SYSDBA.password file. For a secure installation, don’t forget to delete this file later.

    Enter a password followed by Enter.

  • Wait for the install to complete

    Output of 'sudo apt install firebird3.0-server

Using Firebird Server

The Xubuntu “firebird3.0-server” package also installs the “firebird3.0-utils” package, which includes isql-fb, a commandline query tool for Firebird. In a “default” Firebird installation, this tool is actually called isql (short for Interactive SQL), but because other database systems and for example UnixODBC also use a tool called isql, this Debian/Ubuntu/Xubuntu package renamed it to isql-fb.

For more information on isql/isql-fb, you can read the Firebird’s isql Interactive SQL Utility manual.

After installation, the Firebird server will have been started automatically, and is ready for immediate use.

File and directory layout

The layout of files for the Xubuntu Firebird installation differs from “default” Firebird installations.

The location of some important files:

Configuration files like firebird.conf, databases.conf, etc

/etc/firebird/3.0/

Security database

/var/lib/firebird/3.0/system/security3.fdb

Log file

/var/log/firebird/firebird3.0.log

The default expectation of the Xubuntu package is that you put (server-based) database files in /var/lib/firebird/3.0/data. If you want to put it somewhere else, make sure the directory is owned by the user firebird, and — optionally, but recommended — the group firebird.

Unfortunately, specifying a relative path when creating a database puts it in /tmp, so make to sure to specify an absolute path, or define an alias in /etc/firebird/3.0/databases.conf before creating the database.

  • A simple example of creating a database through the localhost Firebird server:

    mark@xubuntu2310-vm:~$ isql-fb -user sysdba -f stdin
    Enter password:
    Use CONNECT or CREATE DATABASE to specify a database
    SQL> create database 'localhost:/var/lib/firebird/3.0/data/testdatabase.fdb' default character set UTF8;
    SQL>
Stopping and starting Firebird server

You can stop and start the Firebird server in two ways:

  1. Stop: /etc/init.d/firebird3.0 stop
    Start: /etc/init.d/firebird3.0 start

    This will call systemctl of the next option.

  2. Stop: systemctl stop firebird3.0.service
    Start: systemctl start firebird3.0.service

Both options will prompt you for your password through a popup, or you can run the command with sudo to get the prompt in the terminal.

Using Firebird Embedded

Firebird also comes with an embedded mode, which allows you to access databases without going through Firebird server. However, using Firebird Embedded does require some care, because by default it will share things like lock files and temporary directories with the normal Firebird installation (and this is recommended!).

Given the privileges required to access those directories, for normal Firebird Embedded usage, this means that you need to add yourself to the firebird group.

  • Run sudo usermod -a -G firebird <your-username>

  • Next run newgrp firebird to make the additional group privileges available to your user account

    The command newgrp firebird only has effect in your current terminal. As long as you don’t log out and log back in, you will need to run newgrp firebird in each new terminal you open!

    If you expect to start a lot of different terminals, you may want to log out and log back in before continuing, as it removes the need for using newgrp.

  • Example connecting using Firebird Embedded to the database created previously:

    mark@xubuntu2310-vm:~$ isql-fb -user sysdba /var/lib/firebird/3.0/data/testdatabase.fdb
    Database: /var/lib/firebird3.0/data/testdatabase.fdb, User: SYSDBA
    SQL>

    The difference with connecting through the server is that we don’t specify a hostname, and we only need to specify a username, and no password. The fact that you have filesystem access to the database is considered sufficient authorization to access the database. The username is used to determine which privileges and roles you have available within the database.

Creating a database in your home directory

When using Firebird Embedded, you can also create databases in your home directory. These databases will only be accessible by your user account (unless you compromise security by giving the firebird user and/or group access to your home directory, which you should not do).

mark@xubuntu2310-vm:~$ isql-fb
Use CONNECT or CREATE DATABASE to specify a database
SQL> create database '/home/mark/personal-database.fdb';
SQL>

You do need to specify the absolute path (or you can use ~ to resolve your home directory). If you don’t specify a username when starting isql-fb or in the CREATE DATABASE statement, it will use your Linux username as the database username:

SQL> select current_user from RDB$DATABASE;

USER
===============================
MARK

SQL>

The End

This concludes the quick tutorial on installing Firebird on Xubuntu. If you want to know more about Firebird, consult the documentation on the Firebird website.

For questions, you can reach out to the community on firebird-support.


1. FlameRobin is a GUI query tool for Firebird

Jaybird 5.0.4 released

10 March 2024

We are happy to announce the release of Jaybird 5.0.4.

The following has been fixed since Jaybird 5.0.3:

  • Firebird 5.0 is now formally supported

  • Fixed: Potential NPE when warningMessageCallback is null while reading operations or consuming packets (#778)

  • Fixed: FBRowUpdater incorrectly considers result set with only partial PK updatable — backported from Jaybird 6 (#780)

  • Fixed: Use of offset timezone names (e.g. +05:00) for sessionTimeZone would result in a warning being logged, and an incorrect conversion applied (in UTC instead of the offset) when using the legacy time types — backported from Jaybird 6 (#787)

Jaybird 5 supports Firebird 2.5 and higher, on Java 8, 11, 17 and 21 (support for Java 11 and higher using the Java 11 version of the driver).

See also:

Jaybird 5.0.3 and 4.0.10 released

24 November 2023

We are happy to announce the release of Jaybird 5.0.3 and Jaybird 4.0.10.

With this release, Jaybird 4 is end-of-life. We recommend upgrading to Jaybird 5.

Jaybird 5.0.3

The following has been changed or fixed since Jaybird 5.0.2:

  • Improvement: Do not reject attempts to read blob id 0 — backported from Jaybird 6 (#765)

    Previously, Jaybird rejected attempts to read blobs with blob id 0 (not on all code paths, for some only when assertions are enabled). Formally, blob id 0 is not a valid blob id, but in practice they can occur (e.g. due to bugs, or access components/drivers explicitly setting a blob column to id 0). Other drivers and tools simply send the requests for blob id 0 to the server, which then treats it as an empty blob. For consistency, we decided to let Jaybird handle it the same.

  • Fixed: on CHAR fields, a too short value could be returned if the string contained one or more codepoints represented by surrogate pairs and the string length in char exceeded the maximum string length — backported from Jaybird 6 (#770)

    We now truncate the returned string if the codepoint count exceeds the maximum string length.

  • Fixed: CallableStatement.getXXX(String) could return value from wrong column — backported from Jaybird 6 (#772)

  • Updated: error messages updated from Firebird 5.0.0.1272

Jaybird 5 supports Firebird 2.5 and higher, on Java 8, 11, 17, and 21 (support for Java 11 and higher using the Java 11 version of the driver).

See also:

Jaybird 4.0.10

Jaybird 4.0.10 is the last release of Jaybird 4, and Jaybird 4 is now end-of-life. We recommend upgrading to Jaybird 5.

The following has been changed or fixed since Jaybird 4.0.9

  • Fixed: Reconnect transaction with a transaction id exceeding 0x7FFF_FFFF did not work (#734)

  • Fixed: CallableStatement.getXXX(String) could return value from wrong column — backported from Jaybird 6 (#773)

  • Updated: error messages updated from Firebird 5.0.0.1272

Jaybird 4 supports Firebird 2.5 and higher, on Java 7, 8, 11, 17, and 21 (support for Java 11 and higher using the Java 11 version of the driver).

See also:


Older posts are available in the archive.