Top Description Fields Constructors Methods
org.postgresql.jdbc

public Class BatchResultHandler

extends ResultHandlerBase
Class Inheritance
Known Direct Subclasses
org.postgresql.jdbc.CallableBatchResultHandler
Static Imports
org.postgresql.util.internal.Nullness.castNonNull

Internal class, it is not a part of public API.

Field Summary

Modifier and TypeField and Description
private final @Nullable List<List<Tuple>>
private int
private final boolean
private @Nullable PgResultSet
generatedKeys

References Deprecated PgResultSet is deprecated or references (maybe indirectly) at least one deprecated element.
private @Nullable PgResultSet
latestGeneratedKeysRs

References Deprecated PgResultSet is deprecated or references (maybe indirectly) at least one deprecated element.
private @Nullable List<Tuple>
private final long[]
private final @Nullable @Nullable ParameterList[]
private final PgStatement
private final Query[]
private int

Constructor Summary

AccessConstructor and Description
pack-priv
BatchResultHandler(PgStatement pgStatement, Query[] queries, @Nullable @Nullable ParameterList[] parameterLists, boolean expectGeneratedKeys)

Method Summary

Modifier and TypeMethod and Description
public @Nullable ResultSet
public long[]
public int[]
public void
handleCommandStatus(String
the command status string (e.g. "SELECT") returned by the backend
status
,
long
the number of rows affected by an INSERT, UPDATE, DELETE, FETCH, or MOVE command; -1 if not available.
updateCount
,
long
for a single-row INSERT query, the OID of the newly inserted row; 0 if not available.
insertOID
)

Overrides org.postgresql.core.ResultHandlerBase.handleCommandStatus.

Implements org.postgresql.core.ResultHandler.handleCommandStatus.

Called when a query that did not return a resultset completes.

public void
public void
handleError(SQLException
the error that occurred
newError
)

Overrides org.postgresql.core.ResultHandlerBase.handleError.

Implements org.postgresql.core.ResultHandler.handleError.

Called when an error occurs.

public void
handleResultRows(Query fromQuery, Field[] fields, List<Tuple> tuples, @Nullable ResultCursor cursor)

public void
handleWarning(SQLWarning
the warning that occurred.
warning
)

Overrides org.postgresql.core.ResultHandlerBase.handleWarning.

Implements org.postgresql.core.ResultHandler.handleWarning.

Called when a warning is emitted.

private boolean
public void
private long[]
private int[]
private void
Inherited from org.postgresql.core.ResultHandlerBase:
getExceptiongetWarninghandleResultRows

Field Detail

allGeneratedRowsback to summary
private final @Nullable List<List<Tuple>> allGeneratedRows
committedRowsback to summary
private int committedRows
expectGeneratedKeysback to summary
private final boolean expectGeneratedKeys
generatedKeysback to summary
private @Nullable PgResultSet generatedKeys

References Deprecated

PgResultSet is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

latestGeneratedKeysRsback to summary
private @Nullable PgResultSet latestGeneratedKeysRs

References Deprecated

PgResultSet is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

latestGeneratedRowsback to summary
private @Nullable List<Tuple> latestGeneratedRows
longUpdateCountsback to summary
private final long[] longUpdateCounts
parameterListsback to summary
private final @Nullable @Nullable ParameterList[] parameterLists
pgStatementback to summary
private final PgStatement pgStatement
queriesback to summary
private final Query[] queries
resultIndexback to summary
private int resultIndex

Constructor Detail

BatchResultHandlerback to summary
pack-priv BatchResultHandler(PgStatement pgStatement, Query[] queries, @Nullable @Nullable ParameterList[] parameterLists, boolean expectGeneratedKeys)

Method Detail

getGeneratedKeysback to summary
public @Nullable ResultSet getGeneratedKeys()
getLargeUpdateCountback to summary
public long[] getLargeUpdateCount()
getUpdateCountback to summary
public int[] getUpdateCount()
handleCommandStatusback to summary
public void handleCommandStatus(String status, long updateCount, long insertOID)

Overrides org.postgresql.core.ResultHandlerBase.handleCommandStatus.

Implements org.postgresql.core.ResultHandler.handleCommandStatus.

Doc from org.postgresql.core.ResultHandler.handleCommandStatus.

Called when a query that did not return a resultset completes.

Parameters
status:String

the command status string (e.g. "SELECT") returned by the backend

updateCount:long

the number of rows affected by an INSERT, UPDATE, DELETE, FETCH, or MOVE command; -1 if not available.

insertOID:long

for a single-row INSERT query, the OID of the newly inserted row; 0 if not available.

Annotations
@Override
handleCompletionback to summary
public void handleCompletion() throws SQLException

Overrides org.postgresql.core.ResultHandlerBase.handleCompletion.

Implements org.postgresql.core.ResultHandler.handleCompletion.

Doc from org.postgresql.core.ResultHandler.handleCompletion.

Called before a QueryExecutor method returns. This method may throw a SQLException if desired; if it does, the QueryExecutor method will propagate that exception to the original caller.

Annotations
@Override
Exceptions
SQLException:
if the handler wishes the original method to throw an exception.
handleErrorback to summary
public void handleError(SQLException newError)

Overrides org.postgresql.core.ResultHandlerBase.handleError.

Implements org.postgresql.core.ResultHandler.handleError.

Doc from org.postgresql.core.ResultHandler.handleError.

Called when an error occurs. Subsequent queries are abandoned; in general the only calls between a handleError call and a subsequent handleCompletion call are handleError or handleWarning.

Parameters
newError:SQLException

the error that occurred

Annotations
@Override
handleResultRowsback to summary
public void handleResultRows(Query fromQuery, Field[] fields, List<Tuple> tuples, @Nullable ResultCursor cursor)
Annotations
@Override
handleWarningback to summary
public void handleWarning(SQLWarning warning)

Overrides org.postgresql.core.ResultHandlerBase.handleWarning.

Implements org.postgresql.core.ResultHandler.handleWarning.

Doc from org.postgresql.core.ResultHandler.handleWarning.

Called when a warning is emitted.

Parameters
warning:SQLWarning

the warning that occurred.

Annotations
@Override
isAutoCommitback to summary
private boolean isAutoCommit()
secureProgressback to summary
public void secureProgress()

Overrides org.postgresql.core.ResultHandlerBase.secureProgress.

Implements org.postgresql.core.ResultHandler.secureProgress.

Doc from org.postgresql.core.ResultHandler.secureProgress.

Callback for batch statements. In case batch statement is executed in autocommit==true mode, the executor might commit "as it this it is best", so the result handler should track which statements are executed successfully and which are not.

Annotations
@Override
uncompressLongUpdateCountback to summary
private long[] uncompressLongUpdateCount()
uncompressUpdateCountback to summary
private int[] uncompressUpdateCount()
updateGeneratedKeysback to summary
private void updateGeneratedKeys()