Skip to content

Commit 4cfc025

Browse files
committed
SPARK-5239 [CORE] JdbcRDD throws "java.lang.AbstractMethodError: oracle.jdbc.driver.xxxxxx.isClosed()Z"
This is a completion of #4033 which was withdrawn for some reason. Author: Sean Owen <[email protected]> Closes #4470 from srowen/SPARK-5239.2 and squashes the following commits: 2398bde [Sean Owen] Avoid use of JDBC4-only isClosed() (cherry picked from commit 2d1e916) Signed-off-by: Sean Owen <[email protected]>
1 parent 281614d commit 4cfc025

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

core/src/main/scala/org/apache/spark/rdd/JdbcRDD.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,21 @@ class JdbcRDD[T: ClassTag](
9999

100100
override def close() {
101101
try {
102-
if (null != rs && ! rs.isClosed()) {
102+
if (null != rs) {
103103
rs.close()
104104
}
105105
} catch {
106106
case e: Exception => logWarning("Exception closing resultset", e)
107107
}
108108
try {
109-
if (null != stmt && ! stmt.isClosed()) {
109+
if (null != stmt) {
110110
stmt.close()
111111
}
112112
} catch {
113113
case e: Exception => logWarning("Exception closing statement", e)
114114
}
115115
try {
116-
if (null != conn && ! conn.isClosed()) {
116+
if (null != conn) {
117117
conn.close()
118118
}
119119
logInfo("closed connection")

sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRDD.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,21 +370,21 @@ private[sql] class JDBCRDD(
370370
def close() {
371371
if (closed) return
372372
try {
373-
if (null != rs && ! rs.isClosed()) {
373+
if (null != rs) {
374374
rs.close()
375375
}
376376
} catch {
377377
case e: Exception => logWarning("Exception closing resultset", e)
378378
}
379379
try {
380-
if (null != stmt && ! stmt.isClosed()) {
380+
if (null != stmt) {
381381
stmt.close()
382382
}
383383
} catch {
384384
case e: Exception => logWarning("Exception closing statement", e)
385385
}
386386
try {
387-
if (null != conn && ! conn.isClosed()) {
387+
if (null != conn) {
388388
conn.close()
389389
}
390390
logInfo("closed connection")

0 commit comments

Comments
 (0)