Tag: JDBC

The Firebird JDBC team is happy to announce the release of Jaybird 2.2.4.

This release contains the following fixes:

Fixed: Exceptions during statement preparation leave connection and transaction open after explicit close (JDBC-311)

Fixed batch update (or insert) with blob set through setBinaryStream() sets empty blob for all but the first batch entry (JDBC-312)

Fixed incomplete checks of database, transaction, statement and blob handle validity before continuing with actions. These incomplete checks could lead to unexpected exceptions (for example a NullPointerException in iscDatabaseInfo) (JDBC-313)

Fixed: Jaybird should specify dialect 3 in dpb when no explicit dialect was set (JDBC-327)

Fixed: several DatabaseMetaData methods defined by JDBC to only accept the actual table name also accepted a LIKE-pattern or empty string or null. This was changed to conform to JDBC. This change can break applications that relied on the incorrect behavior (JDBC-331)
Affected methods are: getPrimaryKeys, getBestRowIdentifier, getImportedKeys, getExportedKeys and getCrossReference. As part of this change getIndexInfo now handles names in the wrong case slightly different.
Jaybird 3.0 will further modify and restrict the pattern matching and case sensitivity of metadata methods. See Future changes to Jaybird in the release notes for more details.

Changed: Throw SQLException when calling execute, executeQuery, executeUpdate and addBatch methods accepting a query string on a PreparedStatement or CallableStatement as required by JDBC 4.0 (JDBC-288)
NOTE: Be aware that this change can break existing code if you depended on the old, non-standard behavior! With addBatch(String) the old behavior lead to a memory leak and unexpected results.

Added: Support for a connect timeout using connection property connectTimeout. This property can be specified in the JDBC URL or Properties object or on the DataSource. If the connectTimeout property is not specified, the general DriverManager property loginTimeout is used. The value is the timeout in seconds. (JDBC-295)
For the Java wire protocol the connect timeout will detect unreachable hosts. In the JNI implementation (native protocol) the connect timeout works as the DPB item isc_dpb_connect_timeout which only works after connecting to the server for the op_accept phase of the protocol. This means that – for the native protocol – the connect timeout will not detect unreachable hosts within the timeout. As that might be unexpected, an SQLWarning is added to the connection if the property is specified with the native protocol.

As part of the connect timeout change, hostname handling (if the hostname is an IP-address) in the Java wire protocol was changed. This should not have an impact in recent Java versions, but on older Java versions (Java 5 up to update 5) this might result in a delay in connecting using an IP-address, if that address can’t be reverse-resolved to a hostname. Workaround is to add an entry for that IP-address to the /etc/hosts or %WINDIR%\System32\Drivers\etc\hosts file.