@Override public long executeLargeUpdate(String sql, int autoGeneratedKeys) throws SQLException { checkOpen(); return super.executeLargeUpdate(sql, autoGeneratedKeys); }
@Override public boolean isClosed() { try { return super.isClosed(); } catch (SQLException e) { throw new RuntimeException( "Unexpected " + e + " from AvaticaPreparedStatement.isClosed"); } }
@Override public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { checkOpen(); try { return super.execute(sql, autoGeneratedKeys); } catch (UnsupportedOperationException e) { throw new SQLFeatureNotSupportedException(e.getMessage(), e); } }
public long executeLargeUpdate() throws SQLException { checkOpen(); getConnection().executeQueryInternal(this, null, null, new QueryState(getSignature().sql), true); return updateCount; }
public long executeLargeUpdate() throws SQLException { getConnection().executeQueryInternal(this, getSignature(), null, new QueryState(getSignature().sql)); return updateCount; }
@Override public CalciteConnectionImpl getConnection() throws SQLException { return (CalciteConnectionImpl) super.getConnection(); } }
public long[] executeLargeBatch() throws SQLException { checkOpen(); // Overriding the implementation in AvaticaStatement. try { return getConnection().executeBatchUpdateInternal(this); } 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. this.parameterValueBatch.clear(); } }
public int getParameterMode(int param) throws SQLException { //noinspection UnusedDeclaration AvaticaParameter paramDef = getParameter(param); // forces param range check return ParameterMetaData.parameterModeIn; } }
protected AvaticaSite getSite(int param) throws SQLException { checkOpen(); final AvaticaParameter parameter = getParameter(param); return new AvaticaSite(parameter, getCalendar(), param - 1, slots); }
public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { setTimestamp(parameterIndex, x, getCalendar()); }
public void setTime(int parameterIndex, Time x) throws SQLException { setTime(parameterIndex, x, getCalendar()); }
public void setDate(int parameterIndex, Date x) throws SQLException { setDate(parameterIndex, x, getCalendar()); }
@Override public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { checkOpen(); try { return super.executeUpdate(sql, autoGeneratedKeys); } catch (UnsupportedOperationException e) { throw new SQLFeatureNotSupportedException(e.getMessage(), e); } }
@Override protected PreparedStatement newInstance() throws Exception { UnregisteredDriver driver = new TestDriver(); AvaticaConnection connection = new AvaticaConnection(driver, driver.createFactory(), "jdbc:avatica", new Properties()) { }; StatementHandle handle = mock(StatementHandle.class); Signature signature = new Signature(Collections.emptyList(), "", Collections.emptyList(), Collections.emptyMap(), null, Meta.StatementType.SELECT); AvaticaPreparedStatement preparedStatement = new AvaticaPreparedStatement(connection, handle, signature, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT) { }; preparedStatement.close(); assertTrue("Prepared statement is not closed", preparedStatement.isClosed()); return preparedStatement; } }
protected AvaticaSite getSite(int param) throws SQLException { final AvaticaParameter parameter = getParameter(param); return new AvaticaSite(parameter, getCalendar(), param - 1, slots); }
@Override public boolean getMoreResults(int current) throws SQLException { try { return super.getMoreResults(current); } catch (UnsupportedOperationException e) { throw new SQLFeatureNotSupportedException(e.getMessage(), e); } }
@Override public ResultSet getGeneratedKeys() throws SQLException { checkOpen(); try { return super.getGeneratedKeys(); } catch (UnsupportedOperationException e) { throw new SQLFeatureNotSupportedException(e.getMessage(), e); } }
public ResultSet executeQuery() throws SQLException { checkOpen(); this.updateCount = -1; final Signature sig = getSignature(); return getConnection().executeQueryInternal(this, sig, null, new QueryState(sig.sql), false); }
public ResultSet executeQuery() throws SQLException { this.updateCount = -1; final Signature sig = getSignature(); return getConnection().executeQueryInternal(this, sig, null, new QueryState(sig.sql)); }
@Override public CalciteConnectionImpl getConnection() throws SQLException { return (CalciteConnectionImpl) super.getConnection(); } }