Jaybird 3 is still in development. This version is provided for testing purposes only. We'd appreciate your feedback, but we'd like to emphasize that this version is not intended for production.
The protocol implementation has been fundamentally rewritten and changes have been made for stricter JDBC conformance. As a result the driver might exhibit different behavior than previous versions. Read these release notes carefully to see if those differences are intentional.
Bug reports about undocumented changes in behavior are appreciated. Feedback can be sent to the Firebird-java mailing list or reported on the issue tracker http://tracker.firebirdsql.org/browse/JDBC.
Jaybird is a JCA/JDBC driver suite to connect to Firebird database servers.
This driver is based on both the JCA standard for application server connections to enterprise information systems and the well-known JDBC standard. The JCA standard specifies an architecture in which an application server can cooperate with a driver so that the application server manages transactions, security, and resource pooling, and the driver supplies only the connection functionality. While similar to the JDBC XADataSource concept, the JCA specification is considerably clearer on the division of responsibility between the application server and driver.
Jaybird 3.0 is a big change from Jaybird 2.2 and earlier. We have rewritten the entire low-level implementation to be able to support protocol improvements in newer Firebird versions, made changes with a stricter interpretation of the JDBC requirements, and removed some parts that were either obsolete or not functioning correctly.
We recommend that you do not consider Jaybird 3.0 a drop-in replacement for Jaybird 2.2, and study these release notes carefully. Test your product with Jaybird 3.0 before using it in production.
Jaybird 3.0 was tested against Firebird 2.5.6, and 3.0.0, but should also support other Firebird versions from 2.0 and up.
Formal support for Firebird 1.x has been dropped (although in general we expect the driver to work). The Type 2 and embedded server JDBC drivers use JNA to access the Firebird client or embedded library.
This driver does not support InterBase servers due to Firebird-specific changes in the protocol and database attachment parameters that are sent to the server.
Jaybird 3.0 is the last version to support Firebird 2.0 and 2.1.
Jaybird 3.0 supports Java 7 (JDBC 4.1) and Java 8 (JDBC 4.2). Support for earlier Java versions has been dropped.
Rudimentary support for Java 9 (JDBC 4.3) is available using the Java 8 version, but real module support will not be available until Jaybird 3.1.
Jaybird 3.0 is the last version to support Java 7.
Jaybird supports the following specifications:
Specification | Notes |
---|---|
JDBC 4.3 | Driver implements all JDBC 4.3 methods for features supported by Firebird; Java 9 supported using the Java 8 driver. |
JDBC 4.2 | Driver implements all JDBC 4.2 methods for features supported by Firebird. |
JDBC 4.1 | Driver implements all JDBC 4.1 methods for features supported by Firebird. |
JDBC 4.0 | Driver implements all JDBC 4.0 interfaces and supports exception chaining. |
JCA 1.0 | Jaybird provides implementation of javax.resource.spi.ManagedConnectionFactory and related interfaces. CCI interfaces are not supported. Although Jaybird depends on the JCA 1.5 classes, JCA 1.5 compatibility is currently not guaranteed. |
JTA 1.0.1 | Driver provides an implementation of javax.transaction.xa.XAResource interface via JCA framework and XADataSource implementation. |
JMX 1.2 | Jaybird provides a MBean to manage Firebird servers and installed databases via JMX agent. |
Jaybird @VERSION@ is available from Maven central:
Groupid: org.firebirdsql.jdbc
,
Artifactid: jaybird-jdkXX
(where XX
is 17
or 18
).
Version: @VERSION@
For example:
<dependency>
<groupId>org.firebirdsql.jdbc</groupId>
<artifactId>jaybird-jdk18</artifactId>
<version>@VERSION@</version>
</dependency>
If your application is deployed to a Java EE application server, you will need to
exclude the javax.resource:connector-api
dependency, and add it as a provided
dependency:
<dependency>
<groupId>org.firebirdsql.jdbc</groupId>
<artifactId>jaybird-jdk18</artifactId>
<version>@VERSION@</version>
<exclusions>
<exclusion>
<groupId>javax.resource</groupId>
<artifactId>connector-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.resource</groupId>
<artifactId>connector-api</artifactId>
<version>1.5</version>
<scope>provided</scope>
</dependency>
If you want to use Type 2 support (native, local or embedded), you need to explicitly include JNA 4.2.2 as a dependency:
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.2.2</version>
</dependency>
We plan to make native and embedded support a separate library in future releases, and provide Firebird client libraries as Maven dependencies as well.
You can download the latest versions from http://www.firebirdsql.org/en/jdbc-driver/
At minimum Jaybird 3.0 requires jaybird-@[email protected]
and
connector-api-1.5.jar
. You can also use jaybird-full-@[email protected]
as it
includes the connector-api files.
If you deploy your application to a Java EE application server, then you must
use jaybird-@[email protected]
(not -full
!), and not include
connector-api-1.5.jar
as this dependency will be provided by your application
server.
For getGeneratedKeys
support you will need to include
antlr-runtime-4.5.3.jar
on your classpath.
For native, local or embedded support, you will need to include jna-4.2.2.jar
on your classpath.
Upgrade the version of the dependency to @VERSION@. If you use native or
embedded, you will no longer need the jaybird22.dll
or libjaybird22.so
, see
the next section.
For more detailed instructions, see also the information on Maven in [Getting Jaybird 3.0].
If you manage your dependencies manually, you need to do the following:
-
Replace the Jaybird library 2.2 with the 3.0
jaybird-2.2.x.jar
withjaybird-@[email protected]
jaybird-full-2.2.x.jar
withjaybird-full-@[email protected]
-
If installed, remove
antlr-runtime-3.4.jar
and replace it withantlr-runtime-4.5.3.jar
. This library is necessary forgetGeneratedKeys
support. -
If you use native (or embedded) you can remove the native library:
jaybird22.dll
,libjaybird22.so
,jaybird22_x64.jar
orlibjaybird22_x64.so
Instead you need to add
jna-4.2.2.jar
to the classpath of your application. This library is necessary for native, local and embedded support.
When you use Jaybird 3 in Wildfly (or JBoss), you will need to add the module
javax.xml.bind.api
to your module to get it to work.
The minimal module.xml
to use Jaybird 3 under Wildfly is:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.firebirdsql">
<resources>
<resource-root path="jaybird-@[email protected]"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.resource.api"/>
<module name="javax.xml.bind.api"/> <!-- Add this -->
</dependencies>
</module>
The following has been changed or fixed since Jaybird 3.0.0-beta-2
-
Fixed: specifying
org.firebirdsql.jdbc.defaultConnectionEncoding
does not set connection character set (JDBC-473)As part of this fix we also removed the need to have the system property set before Jaybird was loaded. It will now be queried dynamically for each connection without a connection character set.
The following has been changed or fixed since Jaybird 3.0.0-beta-1
- Fixed: Authentication with legacy auth users fails when Firebird 3 uses
AuthServer = Legacy_Auth
(JDBC-460) - Fixed:
jna-4.2.2.jar
was not included in the distribution zip (JDBC-461) - Changed logging of Embedded library to only log on error if none of the libraries could be loaded.
- Fixed: native protocol is 20x-30x slower than Jaybird 2.2 native (JDBC-463)
- Fixed:
ResultSetMetaData.getPrecision
of a numeric column when no transaction is active throws an SQLException (JDBC-464)
As part of this fix, the handling of queries executed byFBDatabaseMetaData
has been changed. Most metadata queries are now kept prepared for reuse.
Support for Java 6 has been dropped.
The driver supports Java 7 and 8 and provides improved support for JDBC 4.1 and JDBC 4.2 features.
The improved support includes
-
Support for
java.time
inset/get/updateObject
-
Support for
java.math.BigInteger
inset/get/updateObject
Contrary to the support required by JDBC (
BIGINT
,VARCHAR
andLONGVARCHAR
), we also support it forSMALLINT
,INTEGER
,NUMERIC
andDECIMAL
). In the case of numeric and decimal, the value will be rounded for non-zero decimal fractions using the logic applied byBigDecimal.toBigInteger()
. -
Support for
getObject(int/String, Class<?>)
-
Support for
setBinaryStream
/setCharacterStream
with no length or (long) length beyondInteger.MAX_VALUE
-
Support for large update counts (but not
setLargeMaxRows
)
Jaybird currently does not formally support Java 9 (JDBC 4.3), although some of the JDBC 4.3 features have been implemented.
You can use the Java 8 driver under Java 9, but it is necessary to add the
java.xml.bind
module using --add-modules java.xml.bind
.
Support for Firebird 1.0 and 1.5 has been dropped. See [Firebird 1.0 and 1.5 no longer supported] for details.
Firebird 2.1 support is improved with the implementation of wire protocol version 11.
Firebird 2.5 support is improved with the implementation of wire protocol version 12.
Firebird 3.0 support is improved with the (partial) implementation of wire protocol 13 and support for the Srp authentication plugin. Version 13 support does not yet provide Firebird 3.0 wire encryption and zlib compression. Wire encryption is planned for Jaybird 3.1. Support for zlib compression is not planned yet.
See also Jaybird and Firebird 3 on the wiki.
Support for protocol version 13 and the SRP authentication was contributed by Hajime Nakagami.
-
Add support for streaming backup and restore (JDBC-256)
This feature was contributed by Ivan Arabadzhiev
Jaybird 3.0 has a substantially rewritten low-level implementation (the wire protocol and native implementation) and a number of changes for JDBC conformance.
The rewrite of the low-level implementation was prompted by the new authentication (and wire encryption) in Firebird 3.0 (protocol version 13), and the fact that other improvements in the Firebird wire protocol (versions 11 and 12) were not yet available in the pure Java implementation in Jaybird. The old implementation of the wire protocol did not lend itself for - easily - supporting multiple protocol versions.
The new low-level implementation also means that the old GDS API
(org.firebirdsql.gds.GDS
) has been removed and is no longer available.
For the native, local and embedded support the use of
jaybirdxx.dll
/libjaybirdxx.so
is no longer necessary. For more details, see
[Type 2 (native) and embedded driver].
We have added support for java.util.logging
, and made it the default logging
implementation.
We have applied the following mapping for the log levels:
Logger.trace
:Level.FINER
Logger.debug
:Level.FINE
Logger.info
:Level.INFO
Logger.warn
:Level.WARNING
Logger.error
:Level.SEVERE
Logger.fatal
:Level.SEVERE
We have also added some options to control logging behavior:
-
System property
org.firebirdsql.jdbc.disableLogging
with valuetrue
will disable logging entirely. -
System property
org.firebirdsql.jdbc.forceConsoleLogger
with valuetrue
will force logging to theSystem.out
for info and lower andSystem.err
for warn and above (debug
andtrace
are disabled in the implementation). -
System property
org.firebirdsql.jdbc.loggerImplementation
to specify an alternative implementation of the interfaceorg.firebirdsql.logging.Logger
.This implementation must be public and must have a public constructor with a single
String
argument for the logger name. See also [Support for log4j 1.x removed] for an example.The
org.firebirdsql.logging.Logger
interface is volatile and might change in future minor releases (but not point/bugfix releases).
Support for Log4J 1.x has been removed. If you really need it, you can implement
the interface org.firebirdsql.logging.Logger
with a public constructor
accepting a single String
parameter (the logger name).
To instruct Jaybird to use this logger implementation, specify the system
property org.firebirdsql.jdbc.loggerImplementation
with the class name.
Say you have created the following implementation
package org.example.jaybird.logging;
public class Log4jLogger implements org.firebirdsql.logging.Logger {
public Log4jLogger(String name) {
// create the logger
}
// implementation of interface
}
You will need to specify:
-Dorg.firebirdsql.jdbc.loggerImplementation=org.example.jaybird.logging.Log4jLogger
Added support for IPv6 address literals in the connection string. This is only supported for the modern-style connection URLs, using the RFC2732 format:
jdbc:firebirdsql://[<ipv6-address>]/<path-or-alias>
jdbc:firebirdsql://[<ipv6-address>]:<port>/<path-or-alias>
Examples:
jdbc:firebirdsql://[::1]/employee
jdbc:firebirdsql://[::192.9.5.5]:3050/employee
jdbc:firebirdsql://[1080::8:800:200C:417A]/employee
etc
IPv6 literals are not supported in the legacy URL format (the
<host>[/port]:<path-or-alias>
format).
Jaybird 3.0 contains a number of changes that might break existing applications.
See also [Compatibility changes] for details.
Jaybird 3.0 requires you to specify the connection character set by either
specifying encoding=<firebird encoding>
or charSet=<Java encoding>
.
For more information see: [Connection rejected without an explicit character set]
The generated keys functionality now requires ANTLR 4.5. Make sure to replace
antlr-runtime-3.4.jar
with the antlr-runtime-4.5.3.jar
included in the
distribution zip. If you use maven this will happen automatically.
As in previous versions: if the ANTLR runtime is not on the classpath, then the generated keys functionality will not be available.
Columns of type CHAR
and VARCHAR
with character set OCTETS
are now handled
as JDBC type BINARY
and VARBINARY
, respectively (JDBC-240)
See also [Character set OCTETS handled as JDBC (VAR)BINARY].
We reimplemented the character set handling in Jaybird which may lead to
different behavior, especially when using NONE
as the connection character set.
See also [Character set handling].
-
Fix: IP-address is reversed on big-endian platforms (JDBC-98)
-
Improved support of JDBC Escape syntax (
{...}
) and supported functions (JDBC-223)The escape parser will now only allow the function names defined in Appendix D of the JDBC specification (4.2 for now). For unsupported functions or functions not listed in Appendix D a
FBSQLParseException
will be thrown.The database metadata will now correctly report supported functions for
getNumericFunctions
,getStringFunctions
,getSystemFunctions
andgetTimeDateFunctions
. -
Nested JDBC escapes are now supported (JDBC-292)
-
Changed locking to coarser blocks with - as far as possible - a single lock object per connection for all connection-derived objects (JDBC-435)
This should prevent deadlocks on concurrent access. In some cases locks were obtained in different order (eg (statement, connection), and (connection, statement)). The downside is reduced concurrency, but as using a connection from multiple threads concurrently is discouraged anyway, that is an acceptable price to pay.
-
DatabaseMetaData.getColumns
will reportYES
forIS_AUTOINCREMENT
andIS_GENERATEDCOLUMN
if the column is an identity column (JDBC-322) -
Added Jaybird-specific columns
JB_IS_IDENTITY
andJB_IDENTITY_TYPE
toDatabaseMetaData.getColumns
to report the type of identity column (JDBC-322)JB_IS_IDENTITY
has eitherYES
orNO
as possible values and can be used to check if the column is really an identity column.Possible values for
JB_IDENTITY_TYPE
are:null
: not an identity column, or unknown identity type,ALWAYS
: aGENERATED ALWAYS AS IDENTITY
column (NOTE: not yet supported by Firebird),BY DEFAULT
: aGENERATED BY DEFAULT AS IDENTITY
column.
You should always retrieve these columns by name, as their position will change when the JDBC specification adds new columns.
-
Added field index to
DataTruncation
exceptions (JDBC-405) -
Added support for
getGeneratedKeys
for batch execution of prepared statements (JDBC-452)
See [Removal of deprecated classes, packages and methods] in [Compatibility changes] for more details.
-
Firebird 3.0.1 does not correctly support
BOOLEAN
parameters, see CORE-5367Either use Firebird 3.0.0 or 3.0.2 (when available).
-
Using a native connection with a Firebird 3 client library to a Firebird 2.5 or older server may be slow to connect. The workaround is to specify the IPv4 address instead of the host name in the connection string, or to use a Firebird 2.5 or earlier
fbclient.dll
.This is caused by CORE-4658
Jaybird 3.0 introduces some changes in compatibility and announces future breaking changes.
The changes due to the new protocol implementation and/or JDBC conformance are listed below.
The list might not be complete, if you notice a difference in behavior that is not listed, please report it as bug. It might have been a change we forgot to document, but it could just as well be an implementation bug.
Columns of type CHAR(n) CHARACTER SET OCTETS
and
VARCHAR(n) CHARACTER SET OCTETS
are now handled as JDBC type
java.sql.Types.BINARY
and java.sql.Types.VARBINARY
, respectively.
The connection property octetsAsBytes
no longer has any effect, metadata and
usage will always be (VAR)BINARY
.
With this change the getters (on result set/callable statement) and setters (prepared/callable statement) and update methods (result set) for columns of this type have been restricted to:
set/get/updateNull
get/set/updateBytes
get/set/updateBinaryStream
get/set/updateAsciiStream
get/set/updateString
(using the default encoding or connection encoding)get/set/updateCharacterStream
(using the default encoding or connection encoding)get/set/updateObject
(withString
,byte[]
,InputStream
,Reader
)
Other getters/setters/updaters or object types supported for
'normal' (VAR)CHAR
fields are not available.
Jaybird will now use the (VAR)CHAR
or BLOB SUB_TYPE TEXT
character set
information for decoding. This means that when using connection character set
NONE
that columns which have an explicit character set will be decoded and
encoded using that character set instead of using the platform default encoding
(or explicitly specified Java character set when specifying both encoding=NONE
and charSet=<some java charset>
).
This may lead to unexpected character conversions if - for example - you have
always been reading and writing Cp1251
data from a WIN1252
column: it will
now be read as Cp1252
. You will need to convert the column and data to the
right character set.
If no explicit character set has been set, Jaybird 3.0 will reject the
connection with an SQLNonTransientConnectionException
with message
"Connection rejected: No connection character set specified (property lc_ctype,
encoding, charSet or localEncoding). Please specify a connection character set
(eg property charSet=utf-8) or consult the Jaybird documentation for more
information." (JDBC-446)
In Jaybird 2.2 and earlier, Jaybird would default to connection character set
NONE
if no character set had been specified (through encoding
and/or charSet
). This can result in incorrect character set
handling when the database is used from different locales.
To prevent potential data-corruption, we no longer allow connecting without an explicit connection character set.
To address this change, explicitly set the connection character set using one of the following options:
-
Use connection property
encoding
(orlc_ctype
) with a Firebird character set name.Use
encoding=NONE
for the old default behavior (with some caveats, see other sections). -
Use connection property
charSet
(orlocalEncoding
) with a Java character set name. -
Use a combination of
encoding
andcharSet
, if you want to reinterpret a Firebird character set in a Java character set other than the default mapping. -
By providing a default Firebird character set with system property
org.firebirdsql.jdbc.defaultConnectionEncoding
. Jaybird will apply the specified character set as the default when no character set is specified in the connection properties.This property only supports Firebird character set names.
Use
-Dorg.firebirdsql.jdbc.defaultConnectionEncoding=NONE
to revert to the old behavior (with some caveats, see other sections).
Support for log4j has been removed, and we now default to java.util.logging
.
The previous default was no logging.
See also [Support for java.util.logging added] and [Support for log4j 1.x removed].
-
FBSQLException
and sub-classes replaced with actualjava.sql.*
exceptions.Over time the JDBC exception hierarchy has become more complicated with more specific exceptions. It was easier to use the
java.sql
exception- hierarchy, than to duplicate the hierarchy within Jaybird.This change does not mean that there are no Firebird-specific
SQLException
sub-classes anymore, but in general we strive to use the standard exceptions where possible. -
Class
FBSQLWarning
has been removed and replaced withjava.sql.SQLWarning
. -
Methods with
throws FBSQLException
changed tothrows SQLException
As we are preferring the standard exceptions, the throws clause has been widened to
SQLException
. Note that most methods already hadthrows SQLException
, so the impact is limited. This change specifically impacts:org.firebirdsql.jdbc.FirebirdPreparedStatement
getExecutionPlan()
getStatementType()
org.firebirdsql.management.FBServiceManager
executeServicesOperation
- A number of classes/methods internal to the Jaybird implementation
-
org.firebirdsql.gds.GDSException
has been removed from exception causes.The new low-level implementation throws
java.sql.SQLException
classes eliminating the need forGDSException
(which was usually set as thecause
of anSQLException
). In some cases uses ofGDSException
have been replaced byorg.firebirdsql.jdbc.FBSQLExceptionInfo
to report exception message elements and their error codes. -
Exception message format changed:
-
Exception message elements are now separated by semi-colon, not by linebreak.
Errors reported by Firebird can consist of multiple elements. In Jaybird 2.2 and earlier the final exception message was constructed by separating these elements by a linebreak. These elements are now separated by a semi-colon and a space.
-
Exception message now reports SQLState and error code.
For example, a "Table unknown" (error 335544580) in Jaybird 3.0 has message:
Dynamic SQL Error; SQL error code = -204; Table unknown; TABLE_NON_EXISTENT; At line 1, column 13 [SQLState:42S02, ISC error code:335544580]
Jaybird 2.2 and earlier reported this as (
\n
added to show line break):Dynamic SQL Error\n SQL error code = -204\n Table unknown\n TABLE_NON_EXISTENT\n At line 1, column 13
The SQLState and error code are only included in the message if the exception is constructed using
FbExceptionBuilder
(for example errors received from Firebird). Some parts of the code construct anSQLException
directly, those messages do not contain the SQLState and error code in the message. We strive to improve that in future versions. -
-
More specific error reported by
SQLException.getErrorCode
andSQLException.getSQLState
.In previous versions a large class of errors always reported error 335544569 ("Dynamic SQL Error" or
isc_dsql_error
) with SQLState 42000, Jaybird now tries to find a more specific error code (and SQLState) in the status vector. -
Added Jaybird specific error codes for some exceptions. The error code range
337248256
-337264639
has been reserved by the Firebird project for use by Jaybird.We will migrate more Jaybird-specific exceptions to these error codes in future versions.
Support for Firebird 1.0 and 1.5 has been dropped in Jaybird 3.0. In general we
expect the driver to remain functional, but chances are certain metadata (eg
DatabaseMetaData
) will break if we use features introduced in newer versions.
In general we will no longer fix issues that only occur with Firebird 1.5 or earlier.
Support for Java 6 (JDBC 4.0) has been dropped in Jaybird 3.0. The Jaybird 3.0 sources no longer compile with Java 6 due to use of Java 7 language features and JDBC 4.1 specific features.
Support for Java 5 was already removed with Jaybird 2.2.8.
In Jaybird 3.0 a number of changes were made for stricter compliance to the JDBC specification.
Unless explicitly indicated, changes also apply to PreparedStatement
and
CallableStatement
-
Generated keys
ResultSet
is only available throughgetGeneratedKeys
.The generated keys
ResultSet
from a statement is no longer available throughgetResultSet
, but only throughgetGeneratedKeys
as the JDBC specification does not consider the generated keysResultSet
a normalResultSet
.This applies to statements executed (or prepared) using:
Statement.execute(String, int)
orStatement.executeUpdate(String, int)
with valueStatement.RETURN_GENERATED_KEYS
,Statement.execute(String, int[])
orStatement.executeUpdate(String, int[])
,Statement.execute(String, String[])
orStatement.executeUpdate(String, String[])
,Connection.prepareStatement(String, int)
with valueStatement.RETURN_GENERATED_KEYS
,Connection.prepareStatement(String, int[])
,Connection.prepareStatement(String, String[])
.
This change does not apply to executing
INSERT ... RETURNING ...
as a normal statement. -
Update count immediately available after executing generated keys queries.
Previously the update count of a generated keys query was only available after calling
getMoreResults
followed by a call togetUpdateCount
. This change means thatexecuteUpdate
will now correctly return the update count (usually1
) instead of-1
. The same applies to callinggetUpdateCount
afterexecute
(without the need to callgetMoreResults
).For the definition of generated keys queries see the previous item.
-
Use of function escapes (
{fn ...}
) not defined in the JDBC standard will now throw anFBSQLParseException
, previously the escape was removed and the function was used as is.
Unless explicitly indicated, changes also apply to CallableStatement
-
Method
setUnicodeStream
now always throws anSQLFeatureNotSupportedException
. The previous implementation did not conform to the (deprecated) JDBC requirements and instead behaved likesetBinaryStream
.For the behavior in Jaybird 2.2 and earlier, use
setBinaryStream
. Otherwise usesetCharacterStream
. -
Methods
setNString
,setNClob
, andsetNCharacterStream
will now behave as their counterpart withoutN
(iesetString
,setClob
, andsetCharacterStream
)This implementation is not compliant with the JDBC requirements for
NVARCHAR/NCHAR/NCLOB
support, it is only provided for compatibility purposes.
-
Methods
getNString
,getNClob
, andgetNCharacterStream
will now behave as their counterpart withoutN
(iegetString
,getClob
, andgetCharacterStream
)This implementation is not compliant with the JDBC requirements for
NVARCHAR/NCHAR/NCLOB
support, it is only provided for compatibility purposes.
-
Method
getUnicodeStream
now always throws anSQLFeatureNotSupportedException
. The previous implementation did not conform to the (deprecated) JDBC requirements and instead behaved likegetBinaryStream
.For the behavior in Jaybird 2.2 and earlier, use
getBinaryStream
. Otherwise usegetCharacterStream
. -
Methods
getNString
,updateNString
,getNClob
,updateNClob
,getNCharacterStream
, andupdateNCharacterStream
will now behave as their counterpart withoutN
(iegetString
,updateString
,getClob
,updateClob
,getCharacterStream
, andupdateCharacterStream
)This implementation is not compliant with the JDBC requirements for
NVARCHAR/NCHAR/NCLOB
support, it is only provided for compatibility purposes.
-
The
Clob
implementations of the driver now also implementNClob
so they can be returned fromgetNClob
.This implementation is not compliant with the JDBC requirements for
NVARCHAR/NCHAR/NCLOB
support, it is only provided for compatibility purposes.
The java.sql.DatabaseMetaData
implementation has been changed to follow the
JDBC requirements for object name pattern or object name parameters (referred to
as patterns in the rest of this section).
These changes affect all methods that accept one or more pattern or name
parameters and return a ResultSet
. This includes, but is not limited to,
getTables
and getColumns
.
In Firebird unquoted object names are stored upper case, while quoted object names are stored as is. The JDBC specification states that the pattern must match the object name as stored in the database. This means the pattern should be case sensitive.
The changes made are as follows:
null
will always be interpreted as"%"
(before this rule was applied inconsistently)- Empty string will no longer match (ie they are no longer interpreted as
"%"
) unless explicitly allowed by the method javadoc (usually only thecatalogPattern
andschemaPattern
, which are always ignored by Jaybird as Firebird currently doesn't support this) - Double quotes around a pattern will no longer be stripped, and therefor will now never match existing object names
- The driver will no longer try the uppercase variant of the provided pattern(s) if the original value(s) did not yield a result
- Object name parameters that are not patterns (as indicated by the absence of
Pattern
in the parameter name) will no longer have backslashes removed
Review your DatabaseMetaData
usage and make the following changes:
- Empty string parameters: replace with
"%"
(ornull
) - Double quotes around patterns: remove the double quotes
- Casing of patterns should be reviewed for correctness
- Non-pattern parameters containing
\
should be reviewed for correctness
Some examples:
CREATE TABLE tablename ( -- tablename is stored as TABLENAME in metadata
column1 INTEGER, -- column1 is stored as COLUMN1 in metadata
"column2" INTEGER -- "column2" is stored as column2 in metadata
);
In Jaybird 2.2 using getColumns(null, null, "tablename", "column%")
returns
COLUMN1
(!). In Jaybird 3.0 this produces no rows as tablename
does not
match TABLENAME
.
Changing the query to getColumns(null, null, "TABLENAME", "column%")
in
Jaybird 2.2 and 3.0 produces only one row (column2
), as COLUMN1
does not
match column%
.
In Jaybird 2.2 using getColumns(null, null, "\"TABLENAME\"", "column%")
returns column2
, in Jaybird 3.0 this produces no rows as quotes are no
longer stripped.
In Jaybird 2.2 using getColumns(null, null, "TABLENAME", "")
returns all
columns of the table, in Jaybird 3.0 this produces no rows as empty string
does not match any column. Instead, you should use
getColumns(null, null, "TABLENAME", "%")
.
Apart from the change described above, the following has changed for getTables
- The result set is now sorted by
TABLE_TYPE
and then byTABLE_NAME
as required by the JDBC API doc, previously we only only sorted onTABLE_NAME
. - Support for table type
"GLOBAL TEMPORARY"
added for databases with ODS 11.2 or higher (Firebird 2.5 or higher). In previous versions, the global temporary tables were reported as normal tables (type"TABLE"
)
The old GDS API (org.firebirdsql.gds.GDS
) and its implementations have been
removed. This removal includes a number of related classes and methods. Classes
and interfaces in the org.firebirdsql.gds
package and sub-packages that still
exist may have moved to other packages, or may have a changed API.
In general we advise you to not use the low-level implementation directly. If you see something that is only possible through the low-level API, please file an improvement ticket or create a pull request to add it to the JDBC or management classes.
Jaybird no longer needs a jaybirdxx.dll
or libjaybirdxx.so
for the Type 2
and embedded driver. Jaybird now uses JNA to access the client library.
If you want to use the Type 2 driver, or Firebird embedded, then you need to
include the jna-4.2.2.jar
on the classpath.
When using Maven, you need to specify the dependency on JNA yourself, as we don't depend on it by default:
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.2.2</version>
</dependency>
The fbclient.dll
, fbembed.dll
, libfbclient.so
, or libfbembed.so
need to
be on the path, or the location needs to be specified in the system property
jna.library.path
.
In the future we will move the Type 2 support to a separate library and provide JNA-compatible jars that provide the native libraries of a specific Firebird version.
The classes in org.firebirdsql.pool
and org.firebirdsql.pool.sun
have been
removed completely, with the exception of
org.firebirdsql.pool.FBSimpleDataSource
. This class has been moved to
org.firebirdsql.ds.FBSimpleDataSource
. A subclass with the same name is kept
in org.firebirdsql.pool
for backwards compatibility. This subclass will be
removed in Jaybird 3.1.
With this change, there are no javax.sql.DataSource
implementations in Jaybird
that provide connection pooling (the javax.sql.ConnectionPoolDataSource
implementations are for use by a connection pool and not a connection pool
themselves). Either use the connection pool provided by your application server,
or use a third-party connection pool like c3p0,
Apache DBCP or HikariCP.
The class org.firebirdsql.jca.FBXADataSource
has been removed as well. Its
replacement is org.firebirdsql.ds.FBXADataSource
(which was introduced in
Jaybird 2.2).
All method definitions in the interface
org.firebirdsql.jdbc.FirebirdSavepoint
were removed, and methods referencing
this interface in org.firebirdsql.jdbc.FirebirdConnection
have been removed as
the interface duplicated the java.sql.Savepoint
interface and related methods
in java.sql.Connection
. The interface itself remains for potential future
Firebird-specific extensions.
The following classes, interfaces and/or methods had their visibility reduced as they are implementation artifacts, and should not be considered API:
org.firebirdsql.jdbc.FBDriverPropertyManager
(to package private)
In FBMaintenanceManager
the following changes have been made:
getLimboTransactions()
will returnlong[]
instead ofint[]
limboTransactionsAsList()
will returnList<Long>
instead ofList<Integer>
getLimboTransactionsAsLong()
(introduced in 2.2.11) has been removed in favor ofgetLimboTransactions()
limboTransactionsAsLongList
(introduced in 2.2.11) has been removed in favor oflimboTransactionsAsList
These methods were previously not defined in the MaintenanceManager
interface.
- In some cases
ResultSetMetaData.getPrecision
will estimate the precision. In Jaybird 2.2 and earlier the estimate used forNUMERIC
andDECIMAL
was19
, this has been revised to the more correct value of18
. ResultSetMetaData.getColumnDisplaySize
was revised to take into account space for sign and decimal separator for numeric types.
With Jaybird 3.1 the following breaking changes will be introduced.
Jaybird 3.1 will drop support for Firebird 2.0 and 2.1. In general we expect the
driver to remain functional, but chances are certain metadata (eg
DatabaseMetaData
) will break if we use features introduced in newer versions.
Jaybird 3.1 will very likely drop support for Java 7 (this decision is not final yet).
The following methods will be removed in Jaybird 3.1:
-
CharacterTranslator.getMapping()
, useCharacterTranslator.getMapping(char)
instead.Complete removal of the character translation support is also being considered, as similar effects can be achieved by a custom encoding implementation.
-
GDSHelper.iscVaxInteger(byte[] buffer, int pos, int length)
useVaxEncoding.iscVaxInteger(byte[] buffer, int startPosition, int length)
instead. -
GDSHelper.iscVaxLong(byte[] buffer, int pos, int length)
useVaxEncoding.iscVaxLong(byte[] buffer, int startPosition, int length)
instead. -
MaintenanceManager.commitTransaction(int transactionId)
, useMaintenanceManager.commitTransaction(long transactionId)
instead. -
MaintenanceManager.rollbackTransaction(int transactionId)
, useMaintenanceManager.rollbackTransaction(long transactionId)
instead.
The following constants will be removed in Jaybird 3.1:
- All
SQL_STATE_*
constants inFBSQLException
,FBResourceTransactionException
,FBResourceException
, andFBDriverNotCapableException
will be removed. Use equivalent constants inorg.firebirdsql.jdbc.SQLStateConstants
.