diff --git a/doc/changes/changes_2.1.2.md b/doc/changes/changes_2.1.2.md index a7bcbfa..9bc9e23 100644 --- a/doc/changes/changes_2.1.2.md +++ b/doc/changes/changes_2.1.2.md @@ -8,6 +8,7 @@ Code name: * 194: Wrong name of Exasol JDBC format in documentation * 197: Committing transaction in the finally handler +* 198: Remove unused `Statement` variable ## Dependency Updates diff --git a/exasol-jdbc/src/main/scala/com/exasol/spark/rdd/ExasolRDD.scala b/exasol-jdbc/src/main/scala/com/exasol/spark/rdd/ExasolRDD.scala index b77466e..d0e2883 100644 --- a/exasol-jdbc/src/main/scala/com/exasol/spark/rdd/ExasolRDD.scala +++ b/exasol-jdbc/src/main/scala/com/exasol/spark/rdd/ExasolRDD.scala @@ -94,7 +94,6 @@ class ExasolRDD( override def compute(split: Partition, context: TaskContext): Iterator[Row] = { var closed = false var resultSet: ResultSet = null - val stmt: Statement = null var conn: EXAConnection = null def close(): Unit = { @@ -110,14 +109,6 @@ class ExasolRDD( case e: Exception => logWarning("Received an exception closing sub resultSet", e) } - try { - if (stmt != null && !stmt.isClosed) { - stmt.close() - } - } catch { - case e: Exception => logWarning("Received an exception closing sub statement", e) - } - try { if (conn != null) { if (!conn.isClosed && !conn.getAutoCommit) { @@ -156,5 +147,4 @@ class ExasolRDD( JdbcUtils.resultSetToRows(resultSet, querySchema) } - }