Skip to content

Commit 38d47ce

Browse files
committed
#906 JDBC 4.5 compat: use type code 2016 for DECFLOAT
1 parent 81a1041 commit 38d47ce

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: Copyright 2018-2022 Mark Rotteveel
1+
// SPDX-FileCopyrightText: Copyright 2018-2026 Mark Rotteveel
22
// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
33
package org.firebirdsql.jdbc;
44

@@ -14,7 +14,14 @@
1414
@Volatile(reason = "Defined types may receive a different type number when standardized in JDBC")
1515
public enum JaybirdType implements SQLType {
1616

17-
@Volatile(reason = "To be standardized by future version of JDBC, will be deprecated")
17+
/**
18+
* Type for {@code DECFLOAT}.
19+
* <p>
20+
* When using Java 26 or higher, use {@code java.sql.JDBCType.DECFLOAT}. This constant might be deprecated and
21+
* removed once Jaybird only supports versions after Java 26.
22+
* </p>
23+
*/
24+
@Volatile(reason = "Prefer java.sql.JDBCType.DECFLOAT when using Java 26 or higher")
1825
DECFLOAT(JaybirdTypeCodes.DECFLOAT);
1926

2027
private final Integer type;

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: Copyright 2018-2020 Mark Rotteveel
1+
// SPDX-FileCopyrightText: Copyright 2018-2026 Mark Rotteveel
22
// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
33
package org.firebirdsql.jdbc;
44

@@ -12,10 +12,15 @@
1212
@Volatile(reason = "Defined type codes may receive a different value when standardized in JDBC")
1313
public final class JaybirdTypeCodes {
1414

15-
// TODO Remove when standardized in JDBC
16-
17-
@Volatile(reason = "To be standardized by future version of JDBC, type code may change")
18-
public static final int DECFLOAT = -6001;
15+
/**
16+
* Type code for {@code DECFLOAT}.
17+
* <p>
18+
* When using Java 26 or higher, use {@code java.sql.Types.DECFLOAT}. This constant might be deprecated and
19+
* removed once Jaybird only supports versions after Java 26.
20+
* </p>
21+
*/
22+
@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")
23+
public static final int DECFLOAT = 2015;
1924

2025
private JaybirdTypeCodes() {
2126
// no instances

0 commit comments

Comments
 (0)