Skip to content

Commit 05d1f53

Browse files
committed
#915 JDBC 4.5 support: getJDBCMinorVersion should report 5 on Java 26+
1 parent 736d50c commit 05d1f53

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,11 @@ private CatalogMetadataInfo getCatalogMetadata() {
20472047
private static final int JDBC_MINOR_VERSION = determineJDBCMinorVersion();
20482048

20492049
private static int determineJDBCMinorVersion() {
2050-
if (Runtime.version().feature() >= 24) {
2050+
int feature = Runtime.version().feature();
2051+
if (feature >= 26) {
2052+
// Java 26 and higher: JDBC 4.5
2053+
return 5;
2054+
} else if (feature >= 24) {
20512055
// Java 24 and higher: JDBC 4.4
20522056
return 4;
20532057
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
SPDX-FileCopyrightText: Copyright 2001-2002 David Jencks
33
SPDX-FileCopyrightText: Copyright 2002-2010 Roman Rokytskyy
44
SPDX-FileCopyrightText: Copyright 2002-2003 Blas Rodriguez Somoza
5-
SPDX-FileCopyrightText: Copyright 2011-2025 Mark Rotteveel
5+
SPDX-FileCopyrightText: Copyright 2011-2026 Mark Rotteveel
66
SPDX-License-Identifier: LGPL-2.1-or-later
77
*/
88
package org.firebirdsql.jdbc;
99

1010
import org.firebirdsql.common.DdlHelper;
11-
import org.firebirdsql.common.FBTestProperties;
1211
import org.firebirdsql.common.extension.UsesDatabaseExtension;
1312
import org.firebirdsql.util.FirebirdSupportInfo;
1413
import org.junit.jupiter.api.AfterAll;
@@ -760,7 +759,8 @@ void testGetJDBCMajorVersion() throws Exception {
760759

761760
@Test
762761
void testGetJDBCMinorVersion() throws Exception {
763-
final int expectedMinor = FBTestProperties.getJavaFeatureVersion() >= 24 ? 4 : 3;
762+
int javaFeatureVersion = getJavaFeatureVersion();
763+
final int expectedMinor = javaFeatureVersion >= 26 ? 5 : (javaFeatureVersion >= 24 ? 4 : 3);
764764
assertEquals(expectedMinor, dmd.getJDBCMinorVersion(), "JDBCMinorVersion");
765765
}
766766

0 commit comments

Comments
 (0)