From 49c1478cf3f107d9f7069bf2102d8cf0b6ca2b12 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Sat, 11 Mar 2017 18:20:01 +0000 Subject: [PATCH] [OPENJPA-2690] Update OSGi Import-Package to support Oracle CLOB/BLOB git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1786518 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/openjpa/jdbc/sql/OracleDictionary.java | 12 ++++++++++-- openjpa/pom.xml | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java index 5d59baaa7..867a8f55a 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java @@ -241,8 +241,8 @@ public class OracleDictionary // all fine } - oracleClob_empty_lob_Method = getMethodByReflection("oracle.sql.CLOB", "empty_lob"); - oracleBlob_empty_lob_Method = getMethodByReflection("oracle.sql.BLOB", "empty_lob"); + oracleClob_empty_lob_Method = getMethodByReflection("oracle.sql.CLOB", "getEmptyCLOB"); + oracleBlob_empty_lob_Method = getMethodByReflection("oracle.sql.BLOB", "getEmptyBLOB"); oracleClob_isEmptyLob_Method = getMethodByReflection("oracle.sql.CLOB", "isEmptyLob"); } @@ -1267,6 +1267,10 @@ public class OracleDictionary throws SQLException { if (EMPTY_CLOB != null) return EMPTY_CLOB; + + if (oracleClob_empty_lob_Method == null) + return null; + try { return EMPTY_CLOB = (Clob) oracleClob_empty_lob_Method.invoke(null, new Object[0]); } catch (Exception e) { @@ -1278,6 +1282,10 @@ public class OracleDictionary throws SQLException { if (EMPTY_BLOB != null) return EMPTY_BLOB; + + if (oracleBlob_empty_lob_Method == null) + return null; + try { return EMPTY_BLOB = (Blob) oracleBlob_empty_lob_Method.invoke(null, new Object[0]); } catch (Exception e) { diff --git a/openjpa/pom.xml b/openjpa/pom.xml index a2588cbae..2bc89036c 100644 --- a/openjpa/pom.xml +++ b/openjpa/pom.xml @@ -121,6 +121,9 @@ org.apache.openjpa.*;version=${project.version} + oracle.jdbc.pool;resolution:=optional, + oracle.jdbc;resolution:=optional, + oracle.sql;resolution:=optional, com.ibm.*;resolution:=optional, org.postgresql.*;resolution:=optional, org.apache.tools.ant.*;resolution:=optional,