title: How do I call java.sql.Connection::abort?
body: <p>I would like to write a <code>SwingWorker</code> that, when the user cancels the task, it: 1) cancels the <code>PreparedStatement</code> and 2) aborts the <code>Connection</code>.</p>
  
  <p>Here is some code to illustrate:</p>
  
  <pre><code>class Task extends SwingWorker&lt;Void, Void&gt; {
  
      Connection conn;
      PreparedStatement p_stmt;
      @Override
      protected Void doInBackground() throws Exception {
          ResultSet results = p_stmt.executeQuery();
          while(results.next()) {
              if(isCancelled())
                  return;
          }
          return null;
      }
  
      void cancell() {
          cancel(true);
          try {
              p_stmt.cancel();
              conn.abort(/* How do I properly implement Executor? */);
          } catch (SQLException e) {
              handleError(e);
          }
      }
  
      @Override
      protected void done() {
          try {
              get();
          } catch (ExecutionException | InterruptedException e) {
              handleError(e);
          }
      }
  }
  
  static void handleError(Exception e) {
      // ...
  }
  </code></pre>
  
  <p>This line:</p>
  
  <pre><code>conn.abort(/* How do I properly implement Executor? */);
  </code></pre>
  
  <p>Is the line I'm interested in. What should I pass to <code>Connection::abort</code>?</p>