Skip to content

Commit b572aef

Browse files
committed
#913 FBDatabaseMetaData.getMinorVersion() should report 4 (for JDBC 4.4) on Java 24 and higher
1 parent e4381cc commit b572aef

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

src/docs/asciidoc/release_notes.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ For known issues, consult <<known-issues>>.
3535

3636
=== Jaybird 6.0.4
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+
3841
The following was fixed or changed since Jaybird 6.0.3:
3942

4043
* Fixed: Statement close of a leaked statement by the cleaner did not detect fatal connection errors (https://github.com/FirebirdSQL/jaybird/issues/879[#879])
@@ -55,9 +58,7 @@ Only Firebird 2.5 (not supported) is affected.
5558
* Fixed: `FBServiceManager.getAuthPlugins()` reported the `dbCryptConfig` value (https://github.com/FirebirdSQL/jaybird/issues/901[#901])
5659
* Dependency update: updated `net.java.dev.jna:jna-jpms` from 5.17.0 to 5.18.1 (used by `jaybird-native`) (https://github.com/FirebirdSQL/jaybird/issues/910[#910])
5760
* Dependency update: updated `org.bouncycastle:bcprov-jdk18on` from 1.81 to 1.83 (used by `chacha64-plugin`) (https://github.com/FirebirdSQL/jaybird/issues/912[#856])
58-
59-
This release is not fully compatible with the upcoming JDBC 4.5 Specification to be introduced with Java 26.
60-
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/913[#913])
6162

6263
=== Jaybird 6.0.3
6364

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,16 @@ private CatalogMetadataInfo getCatalogMetadata() {
19491949
}
19501950

19511951
private static final int JDBC_MAJOR_VERSION = 4;
1952-
private static final int JDBC_MINOR_VERSION = 3;
1952+
private static final int JDBC_MINOR_VERSION = determineJDBCMinorVersion();
1953+
1954+
private static int determineJDBCMinorVersion() {
1955+
if (Runtime.version().feature() >= 24) {
1956+
// Java 24 and higher: JDBC 4.4
1957+
return 4;
1958+
}
1959+
// Assume Java 9 - 23: JDBC 4.3
1960+
return 3;
1961+
}
19531962

19541963
@Override
19551964
public int getJDBCMajorVersion() {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,8 @@ void testGetJDBCMajorVersion() throws Exception {
798798

799799
@Test
800800
void testGetJDBCMinorVersion() throws Exception {
801-
assertEquals(3, dmd.getJDBCMinorVersion(), "JDBCMinorVersion");
801+
final int expectedMinor = Runtime.version().compareTo(Runtime.Version.parse("24")) >= 0 ? 4 : 3;
802+
assertEquals(expectedMinor, dmd.getJDBCMinorVersion(), "JDBCMinorVersion");
802803
}
803804

804805
/**

0 commit comments

Comments
 (0)