Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/src/main/scala/org/apache/spark/rdd/JdbcRDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,21 +369,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")
Expand Down