public class Results extends Object
| Constructor and Description |
|---|
Results()
Single Text query.
|
Results(OceanBaseStatement statement,
int fetchSize,
boolean batch,
int expectedSize,
boolean binaryFormat,
int resultSetScrollType,
int resultSetConcurrency,
int autoGeneratedKeys,
int autoIncrement,
String sql,
ParameterHolder[] parameters)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Connection.abort() has been called, abort remaining active result-set
|
void |
addResultSet(SelectResultSet resultSet,
boolean moreResultAvailable)
Add resultSet to results.
|
void |
addStats(long updateCount,
long insertId,
boolean moreResultAvailable)
Add execution statistics.
|
void |
addStatsError(boolean moreResultAvailable)
Indicate that result is an Error, to set appropriate results.
|
void |
close() |
boolean |
commandEnd()
Indicate that command / batch is finished, so set current resultSet if needed.
|
int |
getAutoGeneratedKeys() |
boolean |
getBatchSucceed() |
SelectResultSet |
getCallableResultSet() |
CmdInformation |
getCmdInformation() |
int |
getCurrentStatNumber() |
Deque<SelectResultSet> |
getExecutionResults() |
int |
getExpectedSize() |
int |
getFetchSize() |
ResultSet |
getGeneratedKeys(Protocol protocol)
Send a resultSet that contain auto generated keys.
|
int |
getMaxFieldSize() |
boolean |
getMoreResults(int current,
Protocol protocol)
Position to next resultSet.
|
ParameterHolder[] |
getParameters() |
SelectResultSet |
getResultSet() |
int |
getResultSetConcurrency() |
int |
getResultSetScrollType() |
String |
getSql() |
OceanBaseStatement |
getStatement() |
int |
getStatementId() |
boolean |
isBatch() |
boolean |
isBinaryFormat() |
boolean |
isFullyLoaded(Protocol protocol)
Indicate if result contain result-set that is still streaming from server.
|
boolean |
isInternalResult() |
boolean |
isRewritten() |
boolean |
isToCursorFetch() |
boolean |
isToPrepareExecute() |
void |
loadFully(boolean skip,
Protocol protocol)
Load fully current results.
|
void |
removeFetchSize() |
void |
setAutoIncrement(int autoIncrement) |
void |
setBatchSucceed(boolean succeed) |
protected void |
setCmdInformation(CmdInformation cmdInformation) |
void |
setInternalResult(boolean internalResult) |
void |
setParameters(ParameterHolder[] parameters) |
void |
setRewritten(boolean rewritten) |
void |
setStatementId(int statementId) |
void |
setToCursorFetch(boolean val) |
void |
setToPrepareExecute(boolean val) |
public Results()
public Results(OceanBaseStatement statement, int fetchSize, boolean batch, int expectedSize, boolean binaryFormat, int resultSetScrollType, int resultSetConcurrency, int autoGeneratedKeys, int autoIncrement, String sql, ParameterHolder[] parameters)
statement - current statementfetchSize - fetch sizebatch - select result possibleexpectedSize - expected sizebinaryFormat - use binary protocolresultSetScrollType - one of the following ResultSet constants:
ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or
ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY
or ResultSet.CONCUR_UPDATABLEautoGeneratedKeys - a flag indicating whether auto-generated keys should be returned; one
of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYSautoIncrement - Connection auto-increment valuesql - sql commandparameters - parameterspublic void addStats(long updateCount,
long insertId,
boolean moreResultAvailable)
updateCount - number of updated rowsinsertId - primary keymoreResultAvailable - is there additional packetpublic void addStatsError(boolean moreResultAvailable)
moreResultAvailable - indicate if other results (ResultSet or updateCount) are available.public int getCurrentStatNumber()
public void addResultSet(SelectResultSet resultSet, boolean moreResultAvailable)
resultSet - new resultSet.moreResultAvailable - indicate if other results (ResultSet or updateCount) are available.public boolean isToCursorFetch()
public void setToCursorFetch(boolean val)
public boolean isToPrepareExecute()
public void setToPrepareExecute(boolean val)
public boolean isInternalResult()
public void setInternalResult(boolean internalResult)
public CmdInformation getCmdInformation()
protected void setCmdInformation(CmdInformation cmdInformation)
public boolean commandEnd()
public SelectResultSet getResultSet()
public SelectResultSet getCallableResultSet()
public void loadFully(boolean skip,
Protocol protocol)
throws SQLException
Lock must be set before using this method
skip - must result be available afterwhileprotocol - current protocolSQLException - if any connection error occurpublic void abort()
throws SQLException
SQLException - exceptionpublic boolean isFullyLoaded(Protocol protocol)
protocol - current protocolpublic boolean getMoreResults(int current,
Protocol protocol)
throws SQLException
current - one of the following Statement constants indicating what should
happen to current ResultSet objects obtained using the method
getResultSet: Statement.CLOSE_CURRENT_RESULT,
Statement.KEEP_CURRENT_RESULT, or Statement.CLOSE_ALL_RESULTSprotocol - current protocolSQLException - if any connection error occur.public int getFetchSize()
public OceanBaseStatement getStatement()
public boolean isBatch()
public int getExpectedSize()
public boolean isBinaryFormat()
public void removeFetchSize()
public int getResultSetScrollType()
public String getSql()
public ParameterHolder[] getParameters()
public ResultSet getGeneratedKeys(Protocol protocol) throws SQLException
example "INSERT INTO myTable values ('a'),('b');INSERT INTO myTable values ('c'),('d'),('e')" will have a resultSet of 2 values, and when Statement.getMoreResults() will be called, a Statement.getGeneratedKeys will return a resultset with 3 ids.
protocol - current protocolSQLException - if autoGeneratedKeys was not set to Statement.RETURN_GENERATED_KEYSpublic void close()
throws SQLException
SQLExceptionpublic int getMaxFieldSize()
public void setAutoIncrement(int autoIncrement)
public int getResultSetConcurrency()
public int getAutoGeneratedKeys()
public boolean isRewritten()
public void setRewritten(boolean rewritten)
public void setStatementId(int statementId)
public int getStatementId()
public void setParameters(ParameterHolder[] parameters)
public boolean getBatchSucceed()
public void setBatchSucceed(boolean succeed)
public Deque<SelectResultSet> getExecutionResults()
Copyright © 2022 oceanbase.com. All rights reserved.