Skip to content
Snippets Groups Projects
Commit 2d1e9167 authored by Sean Owen's avatar Sean Owen
Browse files

SPARK-5239 [CORE] JdbcRDD throws "java.lang.AbstractMethodError:...

SPARK-5239 [CORE] JdbcRDD throws "java.lang.AbstractMethodError: oracle.jdbc.driver.xxxxxx.isClosed()Z"

This is a completion of https://github.com/apache/spark/pull/4033 which was withdrawn for some reason.

Author: Sean Owen <sowen@cloudera.com>

Closes #4470 from srowen/SPARK-5239.2 and squashes the following commits:

2398bde [Sean Owen] Avoid use of JDBC4-only isClosed()
parent c1513463
No related branches found
No related tags found
No related merge requests found
......@@ -99,21 +99,21 @@ class JdbcRDD[T: ClassTag](
override def close() {
try {
if (null != rs && ! rs.isClosed()) {
if (null != rs) {
rs.close()
}
} catch {
case e: Exception => logWarning("Exception closing resultset", e)
}
try {
if (null != stmt && ! stmt.isClosed()) {
if (null != stmt) {
stmt.close()
}
} catch {
case e: Exception => logWarning("Exception closing statement", e)
}
try {
if (null != conn && ! conn.isClosed()) {
if (null != conn) {
conn.close()
}
logInfo("closed connection")
......
......@@ -370,21 +370,21 @@ private[sql] class JDBCRDD(
def close() {
if (closed) return
try {
if (null != rs && ! rs.isClosed()) {
if (null != rs) {
rs.close()
}
} catch {
case e: Exception => logWarning("Exception closing resultset", e)
}
try {
if (null != stmt && ! stmt.isClosed()) {
if (null != stmt) {
stmt.close()
}
} catch {
case e: Exception => logWarning("Exception closing statement", e)
}
try {
if (null != conn && ! conn.isClosed()) {
if (null != conn) {
conn.close()
}
logInfo("closed connection")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment