/* JDBC 4+ requires manual closing of result sets and statements */
if (this.resultSet != null) {
try {
this.resultSet.close();
} catch (SQLException ex) {
throw new D2RQException(ex.getMessage() + "; query was: " + this.sql);
}
}
if (this.database != null) {
try {
this.database.vendor().beforeClose(this.database.connection());
} catch (SQLException ex) {
throw new D2RQException(ex.getMessage() + "; query was: " + this.sql);
}
}
if (this.statement != null) {
try {
this.statement.close();
} catch (SQLException ex) {
throw new D2RQException(ex.getMessage() + "; query was: " + this.sql);
}
}
if (this.database != null) {
try {
this.database.vendor().afterClose(this.database.connection());
} catch (SQLException ex) {
throw new D2RQException(ex.getMessage() + "; query was: " + this.sql);
}
}
}