Package java.sql

Examples of java.sql.Statement.cancel()


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

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


        System.out.println("Statement Test failed (10)");
      }
      catch(SQLException e) { }

      try {
        s.cancel();
        System.out.println("Statement Test failed (11)");
      }
      catch(SQLException e) { }

      if (isDerbyNet)
View Full Code Here

      con.setCatalog(query.getCube().getCatalog());
    }

    if (queryContext.contains(ObjectKey.STATEMENT)) {
      Statement s = queryContext.getStatement();
      s.cancel();
      s.close();
      s = null;
      queryContext.remove();
    }
View Full Code Here

    if (context.containsKey(name)) {
      QueryContext queryContext = context.get(name);
      if (queryContext.contains(ObjectKey.STATEMENT)) {
        Statement stmt = queryContext.getStatement();
        if (stmt != null && !stmt.isClosed()) {
          stmt.cancel();
          stmt.close();
        }
        stmt = null;
        queryContext.remove();
      }
View Full Code Here

    public void statement_bad_cancel_01() throws SQLException {
        JenaConnection conn = this.getConnection();
        Statement stmt = conn.createStatement();

        try {
            stmt.cancel();
        } finally {
            stmt.close();
            conn.close();
        }
    }
View Full Code Here

        System.out.println("Statement Test failed (10)");
      }
      catch(SQLException e) { }

      try {
        s.cancel();
        System.out.println("Statement Test failed (11)");
      }
      catch(SQLException e) { }

      if (isDerbyNet)
View Full Code Here

        if (requestCancle) return ; // balk

        requestCancle = true ;
        try {
            Statement stmt = getStatement();
            stmt.cancel();
        } catch (NullPointerException ex) {
            throw new InterruptedException("can't canceled because of Query is not running, Maybe query is not initialized or is already completed");
        } catch (SQLException ex) {
            throw ex ;
        } finally{
View Full Code Here

      @Override
      public void run() {
        try {
          Thread.sleep(1000);
          System.out.println("Cancelling query: ");
          stmt.cancel();
        } catch (Exception e) {
          // No-op
        }
      }
    });
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

            }

            if (!_running) {
                HenPlus.msg().println(" == INTERRUPTED. Wait for statement to cancel.. ==");
                if (stmt != null) {
                    stmt.cancel();
                }
            }
        } catch (final Exception e) {
            // HenPlus.msg().println(selectStmt.toString());
            throw e; // handle later.
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.