Skip to content

Commit fc94a52

Browse files
committed
#906 JDBC 4.5 compat: use type code 2016 for DECFLOAT
1 parent 5ed88f4 commit fc94a52

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

src/docs/asciidoc/release_notes.adoc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ For known issues, consult <<known-issues>>.
3737

3838
The following was fixed or changed since Jaybird 6.0.4:
3939

40-
* ...
40+
* JDBC 4.5 support: `JaybirdTypeCodes.DECFLOAT` and `JaybirdType.DECFLOAT` now use value `2015` instead of `-6001` (https://github.com/FirebirdSQL/jaybird/issues/906[#906])
41+
+
42+
Applications referencing this constant may need to be recompiled to function correctly with Jaybird 6.0.5 and higher.
43+
If you use Java 26 or higher, we recommend using `java.sql.Type.DECFLOAT` and `java.sql.JDBCType.DECFLOAT` instead.
4144

4245
=== Jaybird 6.0.4
4346

@@ -289,6 +292,10 @@ Jaybird supports the following specifications:
289292
[discrete#jdbc45-compat]
290293
==== Incompatibilities with upcoming JDBC 4.5 Specification
291294

295+
// TODO Revise/rename with state for Jaybird 6.0.5 once https://github.com/FirebirdSQL/jaybird/issues/907 is complete
296+
297+
This section applies to Jaybird 6.0.4 and earlier.
298+
292299
Java 26 (expected in March 2026) will introduce https://jcp.org/aboutJava/communityprocess/maintenance/jsr221/index5.html[JDBC 4.5^] (link to draft).
293300
Jaybird is not yet compatible with some of the specified changes.
294301

@@ -298,6 +305,8 @@ Specifically affected are:
298305
+
299306
At this time, Jaybird still uses its own constants in `JaybirdType.DECFLOAT` and `JaybirdTypeCodes.DECFLOAT` with value `-6001`.
300307
This value will be changed to match the JDBC specified value, and the constants deprecated, in a future maintenance release of Jaybird.
308+
+
309+
Addressed in Jaybird 6.0.5.
301310
* Introduction of new methods on `java.sql.Connection` -- `enquoteIdentifier`, `enquoteLiteral`, `enquoteNCharLiteral`, and `isSimpleIdentifier`
302311
+
303312
The default implementation provided is not sufficient for Firebird, especially not when connecting to a dialect 1 database.

src/main/org/firebirdsql/jdbc/JaybirdType.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,14 @@
3030
@Volatile(reason = "Defined types may receive a different type number when standardized in JDBC")
3131
public enum JaybirdType implements SQLType {
3232

33-
@Volatile(reason = "To be standardized by future version of JDBC, will be deprecated")
33+
/**
34+
* Type for {@code DECFLOAT}.
35+
* <p>
36+
* When using Java 26 or higher, use {@code java.sql.JDBCType.DECFLOAT}. This constant might be deprecated and
37+
* removed once Jaybird only supports versions after Java 26.
38+
* </p>
39+
*/
40+
@Volatile(reason = "Prefer java.sql.JDBCType.DECFLOAT when using Java 26 or higher")
3441
DECFLOAT(JaybirdTypeCodes.DECFLOAT);
3542

3643
private final Integer type;

src/main/org/firebirdsql/jdbc/JaybirdTypeCodes.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,15 @@
3535
@Volatile(reason = "Defined type codes may receive a different value when standardized in JDBC")
3636
public final class JaybirdTypeCodes {
3737

38-
// TODO Remove when standardized in JDBC
39-
40-
@Volatile(reason = "To be standardized by future version of JDBC, type code may change")
41-
public static final int DECFLOAT = -6001;
38+
/**
39+
* Type code for {@code DECFLOAT}.
40+
* <p>
41+
* When using Java 26 or higher, use {@code java.sql.Types.DECFLOAT}. This constant might be deprecated and
42+
* removed once Jaybird only supports versions after Java 26.
43+
* </p>
44+
*/
45+
@Volatile(reason = "Type code changed in 5.0.12/6.0.5/7.0.0 to match JDBC 4.5 value; prefer java.sql.Types.DECFLOAT when using Java 26 or higher")
46+
public static final int DECFLOAT = 2015;
4247

4348
private JaybirdTypeCodes() {
4449
// no instances

0 commit comments

Comments
 (0)