public synchronized void cancel() throws SQLException { if (openResultSet != null) { openResultSet.cancel(); } // If there is an open result set, it probably just set the same flag. cancelFlag.compareAndSet(false, true); }
public boolean execute(String sql) throws SQLException { checkNotPreparedOrCallable("execute(String)"); executeInternal(sql); // Result set is null for DML or DDL. // Result set is closed if user cancelled the query. return openResultSet != null && !openResultSet.isClosed(); }
protected void close_() { if (!closed) { closed = true; if (openResultSet != null) { AvaticaResultSet c = openResultSet; openResultSet = null; c.close(); } try { // inform the server to close the resource connection.meta.closeStatement(handle); } finally { // make sure we don't leak on our side connection.statementMap.remove(handle.id); } // If onStatementClose throws, this method will throw an exception (later // converted to SQLException), but this statement still gets closed. connection.driver.handler.onStatementClose(this); } }
public synchronized void cancel() throws SQLException { if (openResultSet != null) { openResultSet.cancel(); } }