Example #1
0
 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);
 }
Example #2
0
 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();
 }
Example #3
0
 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);
   }
 }
Example #4
0
 public synchronized void cancel() throws SQLException {
   if (openResultSet != null) {
     openResultSet.cancel();
   }
 }