public void close() throws SQLException { this.prepareSql = null; super.close(); }
public void close() throws SQLException { this.prepareSql = null; super.close(); }
private void closePortal(Portal query) { ResultSet rs = query.rs; if (rs != null) { try { rs.close(); } catch (SQLException e) { LogManager.logDetail(LogConstants.CTX_ODBC, e, "Did not successfully close portal", query.name); //$NON-NLS-1$ } query.rs = null; } try { query.stmt.close(); } catch (SQLException e) { LogManager.logDetail(LogConstants.CTX_ODBC, e, "Did not successfully close portal", query.name); //$NON-NLS-1$ } }
} finally { if (prepareQuery != null) { prepareQuery.close();
} finally { if (prepareQuery != null) { prepareQuery.close();
} finally { if (prepareQuery != null) { prepareQuery.close();
} finally { if (prepareQuery != null) { prepareQuery.close();
} finally { if (prepareQuery != null) { prepareQuery.close();
@Override public UpdateResponse executeUpdate(Command query, List<SQLParameter> parameters) throws SQLException { String sql = query.toString(); LogManager.logDetail(LogConstants.CTX_ODATA, "Teiid-Query:", sql); //$NON-NLS-1$ final PreparedStatementImpl stmt = getConnection().prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT, Statement.RETURN_GENERATED_KEYS); if (!parameters.isEmpty()) { for (int i = 0; i < parameters.size(); i++) { stmt.setObject(i + 1, parameters.get(i).getValue(), parameters.get(i).getSqlType()); } } final int count = stmt.executeUpdate(); final Map<String, Object> keys = getGeneratedKeys(stmt.getGeneratedKeys()); stmt.close(); return new UpdateResponse() { @Override public Map<String, Object> getGeneratedKeys() { return keys; } @Override public int getUpdateCount() { return count; } }; }
} finally { if (prepareQuery != null) { prepareQuery.close();
try { if (stmt != null) { stmt.close();
if (stmt != null) { try { stmt.close(); } catch (SQLException e) {