Skip to content

Commit c9ea156

Browse files
committed
#914 FBDatabaseMetaData.getMinorVersion() should report 4 (for JDBC 4.4) on Java 24 and higher
1 parent e3f277e commit c9ea156

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

src/docs/asciidoc/release_notes.adoc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ For known issues, consult <<known-issues>>.
3535
[#jaybird-5-0-11-changelog]
3636
=== Jaybird 5.0.11
3737

38+
This release is not fully compatible with the upcoming JDBC 4.5 Specification to be introduced with Java 26.
39+
See <<jdbc45-compat>> for more information.
40+
41+
Future maintenance releases of Jaybird 5 may stop expanding Java support to include newly released Java versions.
42+
If you use Java 17 or higher, we recommend upgrading to Jaybird 6.
43+
3844
The following has been changed or fixed since Jaybird 5.0.10:
3945

4046
* Backported fatal error detection improvements for `FBPooledConnection` from Jaybird 6 (https://github.com/FirebirdSQL/jaybird/issues/899[#899])
@@ -52,9 +58,7 @@ A minor breaking change was made in the internal GDS-ng wire API, which should o
5258
+
5359
This fix was backported from Jaybird 6.0.4.
5460
* Dependency update: updated `net.java.dev.jna:jna` from 5.17.0 to 5.18.1 (used by native and embedded protocols) (https://github.com/FirebirdSQL/jaybird/issues/911[#911])
55-
56-
This release is not fully compatible with the upcoming JDBC 4.5 Specification to be introduced with Java 26.
57-
See <<jdbc45-compat>> for more information.
61+
* Fixed: `FBDatabaseMetaData.getMinorVersion()` should report 4 (for JDBC 4.4) on Java 24 and higher (https://github.com/FirebirdSQL/jaybird/issues/914[#914])
5862
5963
[#jaybird-5-0-10-changelog]
6064
=== Jaybird 5.0.10

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,11 +1803,14 @@ public RowIdLifetime getRowIdLifetime() throws SQLException {
18031803
} catch (NumberFormatException e) {
18041804
javaVersionMajor = 1;
18051805
}
1806-
if (javaVersionMajor >= 9) {
1806+
if (javaVersionMajor >= 24) {
1807+
// Java 24 and higher: JDBC 4.4
1808+
tempVersion = 4;
1809+
} else if (javaVersionMajor >= 9) {
18071810
// JDK 9 or higher: JDBC 4.3
18081811
tempVersion = 3;
18091812
} else {
1810-
// JDK 1.8 or lower: JDBC 4.2
1813+
// JDK 1.8: JDBC 4.2
18111814
tempVersion = 2;
18121815
}
18131816
}

src/test/org/firebirdsql/jdbc/FBDatabaseMetaDataTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -858,11 +858,14 @@ void testGetJDBCMajorVersion() throws Exception {
858858
@Test
859859
void testGetJDBCMinorVersion() throws Exception {
860860
String javaVersion = System.getProperty("java.specification.version");
861+
int javaMajor = (int) Double.parseDouble(javaVersion);
861862
int expectedMinor;
862-
if ("1.8".equals(javaVersion)) {
863-
expectedMinor = 2;
864-
} else {
863+
if (javaMajor >= 24) {
864+
expectedMinor = 4;
865+
} else if (javaMajor >= 9) {
865866
expectedMinor = 3;
867+
} else {
868+
expectedMinor = 2;
866869
}
867870

868871
assertEquals(expectedMinor, dmd.getJDBCMinorVersion(), "JDBCMinorVersion");

0 commit comments

Comments
 (0)