public ResultSet getResultSet() throws SQLException { checkOpen(); // NOTE: result set becomes visible in this member while // executeQueryInternal is still in progress, and before it has // finished executing. Its internal state may not be ready for API // calls. JDBC never claims to be thread-safe! (Except for calls to the // cancel method.) It is not possible to synchronize, because it would // block 'cancel'. return openResultSet; }
public ResultSet getResultSet() throws SQLException { checkOpen(); // NOTE: result set becomes visible in this member while // executeQueryInternal is still in progress, and before it has // finished executing. Its internal state may not be ready for API // calls. JDBC never claims to be thread-safe! (Except for calls to the // cancel method.) It is not possible to synchronize, because it would // block 'cancel'. return openResultSet; }
public long getLargeUpdateCount() throws SQLException { checkOpen(); return updateCount; }
public int getResultSetConcurrency() throws SQLException { checkOpen(); return resultSetConcurrency; }
public boolean isPoolable() throws SQLException { checkOpen(); return false; }
public int getMaxFieldSize() throws SQLException { checkOpen(); return 0; }
public int getFetchDirection() throws SQLException { checkOpen(); return fetchDirection; }
public void setLargeMaxRows(long maxRowCount) throws SQLException { checkOpen(); if (maxRowCount < 0) { throw AvaticaConnection.HELPER.createException( "illegal maxRows value: " + maxRowCount); } this.maxRowCount = maxRowCount; }
public synchronized void cancel() throws SQLException { checkOpen(); if (openResultSet != null) { openResultSet.cancel(); } // If there is an open result set, it probably just set the same flag. cancelFlag.compareAndSet(false, true); }
public void clearBatch() throws SQLException { checkOpen(); checkNotPreparedOrCallable("clearBatch()"); this.batchedSql.clear(); }
public void addBatch(String sql) throws SQLException { checkOpen(); checkNotPreparedOrCallable("addBatch(String)"); this.batchedSql.add(Objects.requireNonNull(sql)); }
public synchronized void cancel() throws SQLException { checkOpen(); if (openResultSet != null) { openResultSet.cancel(); } // If there is an open result set, it probably just set the same flag. cancelFlag.compareAndSet(false, true); }
public void addBatch(String sql) throws SQLException { checkOpen(); checkNotPreparedOrCallable("addBatch(String)"); this.batchedSql.add(Objects.requireNonNull(sql)); }
public void setMaxFieldSize(int max) throws SQLException { checkOpen(); if (max != 0) { throw AvaticaConnection.HELPER.createException( "illegal maxField value: " + max); } }
public long executeLargeUpdate(String sql) throws SQLException { checkOpen(); checkNotPreparedOrCallable("executeUpdate(String)"); executeInternal(sql); return updateCount; }
public long[] executeLargeBatch() throws SQLException { checkOpen(); try { return executeBatchInternal(); } finally { // If we failed to send this batch, that's a problem for the user to handle, not us. // Make sure we always clear the statements we collected to submit in one RPC. clearBatch(); } }
public void setQueryTimeout(int seconds) throws SQLException { checkOpen(); if (seconds < 0) { throw AvaticaConnection.HELPER.createException( "illegal timeout value " + seconds); } setQueryTimeoutMillis(seconds * 1000); }
public int getQueryTimeout() throws SQLException { checkOpen(); long timeoutSeconds = getQueryTimeoutMillis() / 1000; if (timeoutSeconds > Integer.MAX_VALUE) { return Integer.MAX_VALUE; } if (timeoutSeconds == 0 && getQueryTimeoutMillis() > 0) { // Don't return timeout=0 if e.g. timeoutMillis=500. 0 is special. return 1; } return (int) timeoutSeconds; }
public void setQueryTimeout(int seconds) throws SQLException { checkOpen(); if (seconds < 0) { throw AvaticaConnection.HELPER.createException( "illegal timeout value " + seconds); } setQueryTimeoutMillis(seconds * 1000); }
public boolean execute(String sql) throws SQLException { checkOpen(); 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(); }