diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/QueryTimeoutConnectionReleasedTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/QueryTimeoutConnectionReleasedTest.java index 57856ef692d..668d0bfdcb0 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/QueryTimeoutConnectionReleasedTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/QueryTimeoutConnectionReleasedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -65,7 +65,7 @@ public void test() { preConnectionsAvailable = serverSession.getReadConnectionPool().getConnectionsAvailable().size(); try { DataReadQuery query = new DataReadQuery(); - String sqlString = "SELECT SUM(e.EMP_ID) from EMPLOYEE e , EMPLOYEE b, EMPLOYEE c, EMPLOYEE d, EMPLOYEE f, EMPLOYEE g, EMPLOYEE h"; + String sqlString = "SELECT SUM(e.EMP_ID) from EMPLOYEE e , EMPLOYEE b, EMPLOYEE c, EMPLOYEE d, EMPLOYEE f, EMPLOYEE g, EMPLOYEE h, EMPLOYEE g"; query.setSQLString(sqlString); query.setQueryTimeout(1); query.useCursoredStream(1, 1); diff --git a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/QueryTimeoutTest.java b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/QueryTimeoutTest.java index 6358056b6dd..a87c765172e 100644 --- a/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/QueryTimeoutTest.java +++ b/foundation/eclipselink.core.test/src/it/java/org/eclipse/persistence/testing/tests/queries/QueryTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -46,7 +46,7 @@ public void test() { } try { DataReadQuery query = new DataReadQuery(); - query.setSQLString("SELECT SUM(e.EMP_ID) from EMPLOYEE e , EMPLOYEE b, EMPLOYEE c, EMPLOYEE d, EMPLOYEE f, EMPLOYEE g, EMPLOYEE h"); + query.setSQLString("SELECT SUM(e.EMP_ID) from EMPLOYEE e , EMPLOYEE b, EMPLOYEE c, EMPLOYEE d, EMPLOYEE f, EMPLOYEE g, EMPLOYEE h, EMPLOYEE g"); query.setQueryTimeout(1); getSession().executeQuery(query); } catch (Exception e) { diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatasourcePlatform.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatasourcePlatform.java index bed4a5e15cc..8f895157272 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatasourcePlatform.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/DatasourcePlatform.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 1998, 2022 Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2019, 2022 IBM Corporation. All rights reserved. + * Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2024 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -298,6 +298,12 @@ public void setConversionManager(ConversionManager conversionManager) { public String getEndDelimiter() { return endDelimiter; } + /** + * Return the driver version. + */ + public String getDriverVersion() { + return ""; + } /** * Delimiter to use for fields and tables using spaces or other special values. @@ -652,6 +658,10 @@ public boolean isOracle12() { return false; } + @Override + public boolean isOracle23() { + return false; + } public boolean isPervasive(){ return false; } diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/Platform.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/Platform.java index edbc1b2bde3..099cfdb3e73 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/Platform.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/internal/databaseaccess/Platform.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2019 IBM Corporation. All rights reserved. + * Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024 IBM Corporation. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -68,6 +68,11 @@ public interface Platform extends CorePlatform, Serializable, */ void setConversionManager(ConversionManager conversionManager); + /** + * Return the driver version. + */ + String getDriverVersion(); + /** * Return the qualifier for the table. Required by some * databases such as Oracle and DB2 @@ -118,6 +123,8 @@ public interface Platform extends CorePlatform, Serializable, boolean isOracle9(); + boolean isOracle23(); + boolean isOracle12(); boolean isPointBase(); diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/Oracle23Platform.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/Oracle23Platform.java new file mode 100644 index 00000000000..7b763f96a3c --- /dev/null +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/Oracle23Platform.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0, + * or the Eclipse Distribution License v. 1.0 which is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause + */ + +// Contributors: +// Oracle - initial API and implementation +package org.eclipse.persistence.platform.database; + +public class Oracle23Platform extends Oracle21Platform { + public Oracle23Platform() { + super(); + } +} \ No newline at end of file diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/oracle/plsql/PLSQLStoredProcedureCall.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/oracle/plsql/PLSQLStoredProcedureCall.java index 9a8a9468098..5ab4ea6dd42 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/oracle/plsql/PLSQLStoredProcedureCall.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/oracle/plsql/PLSQLStoredProcedureCall.java @@ -56,6 +56,8 @@ import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.mappings.structures.ObjectRelationalDatabaseField; +import org.eclipse.persistence.platform.database.DatabasePlatform; +import org.eclipse.persistence.platform.database.jdbc.JDBCTypes; import org.eclipse.persistence.platform.database.oracle.jdbc.OracleArrayType; import org.eclipse.persistence.queries.StoredProcedureCall; import org.eclipse.persistence.sessions.DatabaseRecord; @@ -488,6 +490,7 @@ public void useNamedCursorOutputAsResultSet(String argumentName, DatabaseType da protected void assignIndices() { List inArguments = getArguments(arguments, ParameterType.IN); List inOutArguments = getArguments(arguments, ParameterType.INOUT); + DatabasePlatform platform = this.getQuery().getSession().getPlatform(); inArguments.addAll(inOutArguments); int newIndex = 1; List expandedArguments = new ArrayList<>(); @@ -509,6 +512,10 @@ protected void assignIndices() { } for (PLSQLargument inArg : inArguments) { DatabaseType type = inArg.databaseType; + if (platform.isOracle23() && type == OraclePLSQLTypes.PLSQLBoolean && Helper.compareVersions(platform.getDriverVersion(), "23.0.0") >= 0) { + type = JDBCTypes.BOOLEAN_TYPE; + inArg.databaseType = JDBCTypes.BOOLEAN_TYPE; + } String inArgName = inArg.name; if (!type.isComplexDatabaseType()) { // for XMLType, we need to set type name parameter (will be "XMLTYPE") @@ -562,6 +569,10 @@ protected void assignIndices() { super.useNamedCursorOutputAsResultSet(outArgName); } else { DatabaseType type = outArg.databaseType; + if (platform.isOracle23() && type == OraclePLSQLTypes.PLSQLBoolean && Helper.compareVersions(platform.getDriverVersion(), "23.0.0") >= 0) { + type = JDBCTypes.BOOLEAN_TYPE; + outArg.databaseType = JDBCTypes.BOOLEAN_TYPE; + } if (!type.isComplexDatabaseType()) { // for XMLType, we need to set type name parameter (will be "XMLTYPE") if (type == XMLType) { diff --git a/foundation/org.eclipse.persistence.core/src/main/resources/org/eclipse/persistence/internal/helper/VendorNameToPlatformMapping.properties b/foundation/org.eclipse.persistence.core/src/main/resources/org/eclipse/persistence/internal/helper/VendorNameToPlatformMapping.properties index e06302e2633..e754d575913 100644 --- a/foundation/org.eclipse.persistence.core/src/main/resources/org/eclipse/persistence/internal/helper/VendorNameToPlatformMapping.properties +++ b/foundation/org.eclipse.persistence.core/src/main/resources/org/eclipse/persistence/internal/helper/VendorNameToPlatformMapping.properties @@ -1,6 +1,6 @@ # -# Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 1998, 2019 IBM Corporation. All rights reserved. +# Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2024 IBM Corporation. All rights reserved. # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License v. 2.0 which is available at @@ -36,6 +36,7 @@ # to platform class entries should be placed before less specific entries. Each # platform entry must be on its own line, an entry cannot span multiple lines. +(?is)oracle.*23.*=org.eclipse.persistence.platform.database.oracle.Oracle23Platform (?is)oracle.*21.*=org.eclipse.persistence.platform.database.oracle.Oracle21Platform (?is)oracle.*19.*=org.eclipse.persistence.platform.database.oracle.Oracle19Platform (?is)oracle.*18.*=org.eclipse.persistence.platform.database.oracle.Oracle18Platform @@ -43,6 +44,7 @@ (?is)oracle.*11.*=org.eclipse.persistence.platform.database.oracle.Oracle11Platform (?is)oracle.*10.*=org.eclipse.persistence.platform.database.oracle.Oracle10Platform (?is)oracle.*9.*=org.eclipse.persistence.platform.database.oracle.Oracle9Platform +(?is)core.oracle.*23.*=org.eclipse.persistence.platform.database.Oracle23Platform (?is)core.oracle.*21.*=org.eclipse.persistence.platform.database.Oracle21Platform (?is)core.oracle.*19.*=org.eclipse.persistence.platform.database.Oracle19Platform (?is)core.oracle.*18.*=org.eclipse.persistence.platform.database.Oracle18Platform diff --git a/foundation/org.eclipse.persistence.oracle/src/main/java/org/eclipse/persistence/platform/database/oracle/Oracle23Platform.java b/foundation/org.eclipse.persistence.oracle/src/main/java/org/eclipse/persistence/platform/database/oracle/Oracle23Platform.java new file mode 100644 index 00000000000..165cc669818 --- /dev/null +++ b/foundation/org.eclipse.persistence.oracle/src/main/java/org/eclipse/persistence/platform/database/oracle/Oracle23Platform.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0, + * or the Eclipse Distribution License v. 1.0 which is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause + */ + +// Contributors: +// Oracle - initial API and implementation +package org.eclipse.persistence.platform.database.oracle; + +/** + *

Purpose: + * Supports certain new Oracle 23c data types, and usage of certain Oracle JDBC specific APIs. + *

Supports Oracle JSON data type. + *

Supports Oracle OracleJsonValue derived Java types. + */ +public class Oracle23Platform extends Oracle21Platform { + + /** + * Creates an instance of Oracle 23c database platform. + */ + public Oracle23Platform() { + super(); + } + + + /** + * INTERNAL: + * Check whether current platform is Oracle 23c or later. + * @return Always returns {@code true} for instances of Oracle 23c platform. + * @since 3.0.5 + */ + @Override + public boolean isOracle23() { + return true; + } +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 957134ead49..bcfebd4f14d 100644 --- a/pom.xml +++ b/pom.xml @@ -219,7 +219,7 @@ 42.2.18 1.3.0-alpha5 - 21.3.0.0 + 23.2.0.0 19.3.0.0 12.2.1-2-0