Package java.sql

Examples of java.sql.Statement.cancel()


                stat.execute("script simple drop to '"+dir+"/backup2.sql'");
            }
        };
        task.execute();
        Thread.sleep(200);
        stat.cancel();
        SQLException e = (SQLException) task.getException();
        assertTrue(e != null);
        assertEquals(ErrorCode.STATEMENT_WAS_CANCELED, e.getErrorCode());

        stat.execute("set throttle 1000");
View Full Code Here


                stat.execute("runscript from '"+dir+"/backup.sql'");
            }
        };
        task.execute();
        Thread.sleep(100);
        stat.cancel();
        e = (SQLException) task.getException();
        assertEquals(ErrorCode.STATEMENT_WAS_CANCELED, e.getErrorCode());

        conn.close();
        IOUtils.delete(getBaseDir() + "/backup.sql");
View Full Code Here

                conn.setAutoCommit(false);
                return "${text.result.autoCommitOff}";
            } else if (isBuiltIn(sql, "@cancel")) {
                stat = session.executingStatement;
                if (stat != null) {
                    stat.cancel();
                    buff.append("${text.result.statementWasCanceled}");
                } else {
                    buff.append("${text.result.noRunningStatement}");
                }
                return buff.toString();
View Full Code Here

    protected boolean cancelTaskObject(Object obj)
    {
        Statement ps = (Statement)obj;
        try
        {
            ps.cancel();
            return true;
        }
        catch (SQLException sqle)
        {
            NucleusLogger.DATASTORE_RETRIEVE.warn("Error cancelling query", sqle);
View Full Code Here

    protected boolean cancelTaskObject(Object obj)
    {
        Statement ps = (Statement)obj;
        try
        {
            ps.cancel();
            return true;
        }
        catch (SQLException sqle)
        {
            NucleusLogger.DATASTORE_RETRIEVE.warn("Error cancelling query", sqle);
View Full Code Here

    res.close();
    // A statement should be open even after ResultSet#close
    assertFalse(stmt.isClosed());
    // A Statement#cancel after ResultSet#close should be a no-op
    try {
      stmt.cancel();
    } catch(SQLException e) {
      failWithExceptionMsg(e);
    }
    stmt.close();
View Full Code Here

                    new TaskListener() {

                        public void taskFinished(Task arg0) {
                            if (interrupted) {
                                try {
                                    stmt.cancel();
                                } catch (SQLException ex) {
                                    Exceptions.printStackTrace(ex);
                                }
                            }
                            taskFinish();
View Full Code Here

                sleep(5000);
              } catch (InterruptedException iEx) {
                // ignore
              }

              cancelStmt.cancel();
            } catch (SQLException sqlEx) {
              throw new RuntimeException(sqlEx.toString());
            }
          }
View Full Code Here

      closedConn = getConnectionWithProps((String) null);
      cancelStmt = closedConn.createStatement();

      closedConn.close();

      cancelStmt.cancel();
    } finally {
      if (cancelStmt != null) {
        cancelStmt.close();
      }
View Full Code Here

      closedConn = getConnectionWithProps((String) null);
      cancelStmt = closedConn.createStatement();

      closedConn.close();

      cancelStmt.cancel();
    } finally {
      if (cancelStmt != null) {
        cancelStmt.close();
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.