Skip to content

Commit 86755f4

Browse files
committed
#929 JDBC 4.5 support: getJDBCMinorVersion should report 5 on Java 26+
(backport of #915 from Jaybird 6.0.5)
1 parent 43da05e commit 86755f4

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/docs/asciidoc/release_notes.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ See also <<jdbc-escape-disable-proc>>.
5858
* Fixed: `IndexOutOfBoundsException` in `FBCachedBlob.getBytes(long, int)` for position or length beyond end of data (https://github.com/FirebirdSQL/jaybird/issues/924[#924])
5959
* Fixed: Using native client, password is limited to 255 bytes (https://github.com/FirebirdSQL/jaybird/issues/926[#926])
6060
* Fixed: Infinite loop in `FBPooledConnection#fireConnectionError(SQLException)` if the exception has a chained exception and neither is fatal (https://github.com/FirebirdSQL/jaybird/issues/928[#928])
61+
* JDBC 4.5 support: `FBDatabaseMetaData.getJDBCMinorVersion()` should report 5 (for JDBC 4.5) on Java 25 and higher (https://github.com/FirebirdSQL/jaybird/issues/929[#929])
6162
6263
[#jaybird-5-0-11-changelog]
6364
=== Jaybird 5.0.11

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1808,7 +1808,10 @@ public RowIdLifetime getRowIdLifetime() throws SQLException {
18081808
} catch (NumberFormatException e) {
18091809
javaVersionMajor = 1;
18101810
}
1811-
if (javaVersionMajor >= 24) {
1811+
if (javaVersionMajor >= 26) {
1812+
// Java 26 and higher: JDBC 4.5
1813+
tempVersion = 5;
1814+
} else if (javaVersionMajor >= 24) {
18121815
// Java 24 and higher: JDBC 4.4
18131816
tempVersion = 4;
18141817
} else if (javaVersionMajor >= 9) {

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
package org.firebirdsql.jdbc;
2020

2121
import org.firebirdsql.common.DdlHelper;
22-
import org.firebirdsql.common.FBTestProperties;
2322
import org.firebirdsql.common.extension.UsesDatabaseExtension;
2423
import org.firebirdsql.logging.Logger;
2524
import org.firebirdsql.logging.LoggerFactory;
@@ -858,9 +857,11 @@ void testGetJDBCMajorVersion() throws Exception {
858857

859858
@Test
860859
void testGetJDBCMinorVersion() throws Exception {
861-
int javaMajor = FBTestProperties.getJavaFeatureVersion();
860+
int javaMajor = getJavaFeatureVersion();
862861
int expectedMinor;
863-
if (javaMajor >= 24) {
862+
if (javaMajor >= 26) {
863+
expectedMinor = 5;
864+
} else if (javaMajor >= 24) {
864865
expectedMinor = 4;
865866
} else if (javaMajor >= 9) {
866867
expectedMinor = 3;

0 commit comments

Comments
 (0)