Data type to store simple SQL statement with designated metadata. Allows manipulation of
statement, such as execution, termination, etc. Represented as an intermediate representation for
statements which does not belong directly to Postgres, Spanner, etc.
The number of items that were modified by this execution for DML. 0 for DDL and -1 for
QUERY. Will block or fail depending on the given ResultNotReadyBehavior if the
result is not yet available.
True if at some point in execution an exception was thrown. Fails or blocks depending
on the given ResultNotReadyBehavior if execution has not yet finished.
isBound()
publicbooleanisBound()
Whether this is a bound statement (i.e.: ready to execute)
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class IntermediateStatement (0.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.27.1 (latest)](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.27.0](/java/docs/reference/pgadapter/0.27.0/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.26.0](/java/docs/reference/pgadapter/0.26.0/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.25.0](/java/docs/reference/pgadapter/0.25.0/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.24.0](/java/docs/reference/pgadapter/0.24.0/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.23.1](/java/docs/reference/pgadapter/0.23.1/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.22.1](/java/docs/reference/pgadapter/0.22.1/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.21.0](/java/docs/reference/pgadapter/0.21.0/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.20.0](/java/docs/reference/pgadapter/0.20.0/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.19.1](/java/docs/reference/pgadapter/0.19.1/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.18.4](/java/docs/reference/pgadapter/0.18.4/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.17.0](/java/docs/reference/pgadapter/0.17.0/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.16.0](/java/docs/reference/pgadapter/0.16.0/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.15.0](/java/docs/reference/pgadapter/0.15.0/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.14.1](/java/docs/reference/pgadapter/0.14.1/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.9.0](/java/docs/reference/pgadapter/0.9.0/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.8.0](/java/docs/reference/pgadapter/0.8.0/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.7.0](/java/docs/reference/pgadapter/0.7.0/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.6.1](/java/docs/reference/pgadapter/0.6.1/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement)\n- [0.5.1](/java/docs/reference/pgadapter/0.5.1/com.google.cloud.spanner.pgadapter.statements.IntermediateStatement) \n\n public class IntermediateStatement\n\nData type to store simple SQL statement with designated metadata. Allows manipulation of\nstatement, such as execution, termination, etc. Represented as an intermediate representation for\nstatements which does not belong directly to Postgres, Spanner, etc. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e IntermediateStatement \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Fields\n-------------\n\n### PARSER\n\n protected static final PostgreSQLStatementParser PARSER\n\nConstructors\n------------\n\n### IntermediateStatement(ConnectionHandler connectionHandler, OptionsMetadata options, AbstractStatementParser.ParsedStatement parsedStatement, Statement originalStatement)\n\n protected IntermediateStatement(ConnectionHandler connectionHandler, OptionsMetadata options, AbstractStatementParser.ParsedStatement parsedStatement, Statement originalStatement)\n\n### IntermediateStatement(OptionsMetadata options, AbstractStatementParser.ParsedStatement parsedStatement, Statement originalStatement, ConnectionHandler connectionHandler)\n\n public IntermediateStatement(OptionsMetadata options, AbstractStatementParser.ParsedStatement parsedStatement, Statement originalStatement, ConnectionHandler connectionHandler)\n\nFields\n------\n\n### command\n\n protected final String command\n\n### commandTag\n\n protected String commandTag\n\n### connection\n\n protected final Connection connection\n\n### connectionHandler\n\n protected final ConnectionHandler connectionHandler\n\n### described\n\n protected boolean described\n\n### exception\n\n protected PGException exception\n\n### executed\n\n protected boolean executed\n\n### futureStatementResult\n\n protected Future\u003cStatementResult\u003e futureStatementResult\n\n### hasMoreData\n\n protected boolean hasMoreData\n\n### options\n\n protected final OptionsMetadata options\n\n### originalStatement\n\n protected final Statement originalStatement\n\n### outputStream\n\n protected final DataOutputStream outputStream\n\n### parsedStatement\n\n protected final AbstractStatementParser.ParsedStatement parsedStatement\n\n### statementResult\n\n protected StatementResult statementResult\n\nMethods\n-------\n\n### close()\n\n public void close()\n\nCleanly close the statement. Does nothing if the statement has not been executed or has no\nresult.\n\n### containsResultSet()\n\n public boolean containsResultSet()\n\n### createDataRowResponse(Converter converter)\n\n public WireOutput createDataRowResponse(Converter converter)\n\n### createResultPrefix(ResultSet resultSet)\n\n public WireOutput[] createResultPrefix(ResultSet resultSet)\n\n### createResultSuffix()\n\n public WireOutput[] createResultSuffix()\n\n### describe()\n\n public DescribeResult describe()\n\nMoreso meant for inherited classes, allows one to call describe on a statement. Since raw\nstatements cannot be described, throw an error.\n\n### describeAsync(BackendConnection backendConnection)\n\n public Future\u003cStatementResult\u003e describeAsync(BackendConnection backendConnection)\n\n### executeAsync(BackendConnection backendConnection)\n\n public void executeAsync(BackendConnection backendConnection)\n\n### getCommand()\n\n public String getCommand()\n\n### getCommandTag()\n\n public String getCommandTag()\n\n### getConnection()\n\n public Connection getConnection()\n\n### getConnectionHandler()\n\n public ConnectionHandler getConnectionHandler()\n\n### getException()\n\n public PGException getException()\n\nReturns any execution exception registered for this statement.\n\n### getResultFormatCode(int index)\n\n public short getResultFormatCode(int index)\n\nMoreso intended for inherited classes (prepared statements et al) which allow the setting of\nresult format codes. Here we dafault to string.\n\n### getSql()\n\n public String getSql()\n\n### getStatement()\n\n public String getStatement()\n\n### getStatementResult()\n\n public StatementResult getStatementResult()\n\nReturns the result of this statement as a [StatementResult](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.connection.StatementResult). Fails if the result is not\nyet available.\n\n### getStatementType()\n\n public AbstractStatementParser.StatementType getStatementType()\n\n### getUpdateCount()\n\n public long getUpdateCount()\n\n### getUpdateCount(IntermediateStatement.ResultNotReadyBehavior resultNotReadyBehavior)\n\n public long getUpdateCount(IntermediateStatement.ResultNotReadyBehavior resultNotReadyBehavior)\n\n### handleExecutionException(PGException exception)\n\n public void handleExecutionException(PGException exception)\n\nClean up and save metadata when an exception occurs.\n\n### hasException()\n\n public boolean hasException()\n\n### hasException(IntermediateStatement.ResultNotReadyBehavior resultNotReadyBehavior)\n\n public boolean hasException(IntermediateStatement.ResultNotReadyBehavior resultNotReadyBehavior)\n\n### isBound()\n\n public boolean isBound()\n\nWhether this is a bound statement (i.e.: ready to execute)\n\n### isDescribed()\n\n public boolean isDescribed()\n\n### isExecuted()\n\n public boolean isExecuted()\n\n### isHasMoreData()\n\n public boolean isHasMoreData()\n\n### setCommandTag(String commandTag)\n\n public void setCommandTag(String commandTag)\n\n### setFutureStatementResult(Future\\\u003cStatementResult\\\u003e result)\n\n protected void setFutureStatementResult(Future\u003cStatementResult\u003e result)\n\n### setHasMoreData(boolean hasMoreData)\n\n public void setHasMoreData(boolean hasMoreData)\n\n### setStatementResult(StatementResult statementResult)\n\n public void setStatementResult(StatementResult statementResult)"]]