Package org.mariadb.jdbc.client.result
Class CompleteResult
java.lang.Object
org.mariadb.jdbc.client.result.Result
org.mariadb.jdbc.client.result.CompleteResult
- All Implemented Interfaces:
AutoCloseable,ResultSet,Wrapper,Completion,ServerMessage
- Direct Known Subclasses:
UpdatableResult
Result-set that will retrieve all rows immediately before returning the result-set.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intbefore first row position = initial positionprivate booleanprivate booleanFields inherited from class org.mariadb.jdbc.client.result.Result
closed, context, data, dataSize, exceptionFactory, fieldIndex, loaded, maxRows, metadataList, NULL_LENGTH, outputParameter, reader, resultSetType, rowBuf, rowDecoder, rowPointer, statement, traceEnableFields inherited from interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE -
Constructor Summary
ConstructorsModifierConstructorDescriptionCompleteResult(ColumnDecoder[] metadataList, byte[][] data, Context context, int resultSetType) Specific constructor for internal build result-set, empty resultset, or generated key result-set.privateCompleteResult(ColumnDecoder[] metadataList, CompleteResult prev) CompleteResult(Statement stmt, boolean binaryProtocol, long maxRows, ColumnDecoder[] metadataList, Reader reader, Context context, int resultSetType, boolean closeOnCompletion, boolean traceEnable, boolean mightBeBulkResult) Constructor from exchanges -
Method Summary
Modifier and TypeMethodDescriptionbooleanabsolute(int idx) voidvoidvoidClosing result-set due to closing statement that issue command.static ResultSetcreateResultSet(String[] columnNames, DataType[] columnTypes, String[][] data, Context context, int flags, int resultSetType) Create a result set from given data.static ResultSetcreateResultSet(String columnName, DataType columnType, String[][] data, Context context, int flags, int resultSetType) Specific constructor for generating generated key result-set.voidFetch remaining results.booleanfirst()intintgetRow()booleanbooleanIndicate if result-set is a bulk unitary resultbooleanisFirst()booleanisLast()booleanlast()Recreate Result-set with metadata using alias as name.booleannext()Position resultset to next rowbooleanprevious()booleanrelative(int rows) voidIndicate that result is a bulk resultvoidsetFetchSize(int rows) booleanIndicate of current result-set is a streaming result-setMethods inherited from class org.mariadb.jdbc.client.result.Result
abort, addRowData, cancelRowUpdates, checkClose, checkNotForwardOnly, clearWarnings, close, closeOnCompletion, deleteRow, findColumn, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCurrentRowData, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getMetaData, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isBeforeFirst, isClosed, isOutputParameter, isWrapperFor, loaded, moveToCurrentRow, moveToInsertRow, readNext, refreshRow, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setNullRowBuf, setRow, setStatement, skipRemaining, unwrap, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowData, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
-
Field Details
-
BEFORE_FIRST_POS
protected static final int BEFORE_FIRST_POSbefore first row position = initial position- See Also:
-
bulkResult
private boolean bulkResult -
mightBeBulkResult
private boolean mightBeBulkResult
-
-
Constructor Details
-
CompleteResult
public CompleteResult(Statement stmt, boolean binaryProtocol, long maxRows, ColumnDecoder[] metadataList, Reader reader, Context context, int resultSetType, boolean closeOnCompletion, boolean traceEnable, boolean mightBeBulkResult) throws IOException, SQLException Constructor from exchanges- Parameters:
stmt- current statementbinaryProtocol- does exchanges uses binary protocolmaxRows- maximum number of rowsmetadataList- metadatareader- packet readercontext- connection contextresultSetType- result set typecloseOnCompletion- close statement on completiontraceEnable- network trace exchange possiblemightBeBulkResult- might be a bulk unitary result- Throws:
IOException- if Socket error occursSQLException- for all other kind of errors
-
CompleteResult
-
CompleteResult
public CompleteResult(ColumnDecoder[] metadataList, byte[][] data, Context context, int resultSetType) Specific constructor for internal build result-set, empty resultset, or generated key result-set.- Parameters:
metadataList- metadatadata- result-set datacontext- connection contextresultSetType- result set type
-
-
Method Details
-
setBulkResult
public void setBulkResult()Description copied from class:ResultIndicate that result is a bulk result- Specified by:
setBulkResultin classResult
-
createResultSet
public static ResultSet createResultSet(String columnName, DataType columnType, String[][] data, Context context, int flags, int resultSetType) Specific constructor for generating generated key result-set.- Parameters:
columnName- column keycolumnType- column key typedata- valuescontext- connection contextflags- column flagsresultSetType- result set type- Returns:
- result-set
-
createResultSet
public static ResultSet createResultSet(String[] columnNames, DataType[] columnTypes, String[][] data, Context context, int flags, int resultSetType) Create a result set from given data. Useful for creating "fake" resultSets for DatabaseMetaData, (one example is MariaDbDatabaseMetaData.getTypeInfo())- Parameters:
columnNames- - string array of column namescolumnTypes- - column typesdata- - each element of this array represents a complete row in the ResultSet. Each value is given in its string representation, as in MariaDB text protocol, except boolean (BIT(1)) values that are represented as "1" or "0" stringscontext- connection contextflags- column flagsresultSetType- result set type- Returns:
- resultset
-
newResultsetWithUseAliasAsName
Recreate Result-set with metadata using alias as name.- Returns:
- Result-set with metadata using alias as name
-
next
Description copied from class:ResultPosition resultset to next row- Specified by:
nextin interfaceResultSet- Specified by:
nextin classResult- Returns:
- true if next row exists
- Throws:
SQLException- if any error occurs
-
streaming
public boolean streaming()Description copied from class:ResultIndicate of current result-set is a streaming result-set -
isBulkResult
public boolean isBulkResult()Description copied from class:ResultIndicate if result-set is a bulk unitary result- Specified by:
isBulkResultin classResult- Returns:
- true if unitary result-set
-
fetchRemaining
public void fetchRemaining()Description copied from class:ResultFetch remaining results.- Specified by:
fetchRemainingin classResult
-
closeFromStmtClose
Description copied from class:ResultClosing result-set due to closing statement that issue command.- Overrides:
closeFromStmtClosein classResult- Parameters:
lock- thread locker object
-
isAfterLast
- Specified by:
isAfterLastin interfaceResultSet- Specified by:
isAfterLastin classResult- Throws:
SQLException
-
isFirst
- Specified by:
isFirstin interfaceResultSet- Specified by:
isFirstin classResult- Throws:
SQLException
-
isLast
- Specified by:
isLastin interfaceResultSet- Specified by:
isLastin classResult- Throws:
SQLException
-
beforeFirst
- Specified by:
beforeFirstin interfaceResultSet- Specified by:
beforeFirstin classResult- Throws:
SQLException
-
afterLast
- Specified by:
afterLastin interfaceResultSet- Specified by:
afterLastin classResult- Throws:
SQLException
-
first
- Specified by:
firstin interfaceResultSet- Specified by:
firstin classResult- Throws:
SQLException
-
last
- Specified by:
lastin interfaceResultSet- Specified by:
lastin classResult- Throws:
SQLException
-
getRow
- Specified by:
getRowin interfaceResultSet- Specified by:
getRowin classResult- Throws:
SQLException
-
absolute
- Specified by:
absolutein interfaceResultSet- Specified by:
absolutein classResult- Throws:
SQLException
-
relative
- Specified by:
relativein interfaceResultSet- Specified by:
relativein classResult- Throws:
SQLException
-
previous
- Specified by:
previousin interfaceResultSet- Specified by:
previousin classResult- Throws:
SQLException
-
getFetchSize
- Specified by:
getFetchSizein interfaceResultSet- Overrides:
getFetchSizein classResult- Throws:
SQLException
-
setFetchSize
- Specified by:
setFetchSizein interfaceResultSet- Overrides:
setFetchSizein classResult- Throws:
SQLException
-