Package org.mariadb.jdbc.client.result
Class StreamingResult
- java.lang.Object
-
- org.mariadb.jdbc.client.result.Result
-
- org.mariadb.jdbc.client.result.StreamingResult
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,java.sql.ResultSet
,java.sql.Wrapper
,Completion
,ServerMessage
public class StreamingResult extends Result
-
-
Field Summary
Fields Modifier and Type Field Description private int
dataFetchTime
private int
fetchSize
private java.util.concurrent.locks.ReentrantLock
lock
-
Fields inherited from class org.mariadb.jdbc.client.result.Result
closed, context, data, dataSize, exceptionFactory, loaded, maxRows, metadataList, outputParameter, reader, resultSetType, row, rowPointer, statement
-
-
Constructor Summary
Constructors Constructor Description StreamingResult(Statement stmt, boolean binaryProtocol, long maxRows, ColumnDefinitionPacket[] metadataList, PacketReader reader, Context context, int fetchSize, java.util.concurrent.locks.ReentrantLock lock, int resultSetType, boolean closeOnCompletion, boolean traceEnable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
absolute(int idx)
private void
addStreamingValue()
void
afterLast()
void
beforeFirst()
void
fetchRemaining()
When protocol has a current Streaming result (this) fetch all to permit another query is executing.boolean
first()
int
getFetchSize()
int
getRow()
boolean
isAfterLast()
boolean
isFirst()
boolean
isLast()
boolean
last()
boolean
next()
private void
nextStreamingValue()
This permit to replace current stream results by next ones.boolean
previous()
boolean
relative(int rows)
void
setFetchSize(int fetchSize)
boolean
streaming()
-
Methods inherited from class org.mariadb.jdbc.client.result.Result
abort, addRowData, cancelRowUpdates, checkClose, checkNotForwardOnly, clearWarnings, close, closeFromStmtClose, 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, 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, useAliasAsName, wasNull
-
-
-
-
Constructor Detail
-
StreamingResult
public StreamingResult(Statement stmt, boolean binaryProtocol, long maxRows, ColumnDefinitionPacket[] metadataList, PacketReader reader, Context context, int fetchSize, java.util.concurrent.locks.ReentrantLock lock, int resultSetType, boolean closeOnCompletion, boolean traceEnable) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-
Method Detail
-
nextStreamingValue
private void nextStreamingValue() throws java.sql.SQLException
This permit to replace current stream results by next ones.- Throws:
java.sql.SQLException
- if server return an unexpected error
-
addStreamingValue
private void addStreamingValue() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
fetchRemaining
public void fetchRemaining() throws java.sql.SQLException
When protocol has a current Streaming result (this) fetch all to permit another query is executing.- Specified by:
fetchRemaining
in classResult
- Throws:
java.sql.SQLException
- if any error occur
-
next
public boolean next() throws java.sql.SQLException
-
isAfterLast
public boolean isAfterLast() throws java.sql.SQLException
- Specified by:
isAfterLast
in interfacejava.sql.ResultSet
- Specified by:
isAfterLast
in classResult
- Throws:
java.sql.SQLException
-
isFirst
public boolean isFirst() throws java.sql.SQLException
-
isLast
public boolean isLast() throws java.sql.SQLException
-
beforeFirst
public void beforeFirst() throws java.sql.SQLException
- Specified by:
beforeFirst
in interfacejava.sql.ResultSet
- Specified by:
beforeFirst
in classResult
- Throws:
java.sql.SQLException
-
afterLast
public void afterLast() throws java.sql.SQLException
-
first
public boolean first() throws java.sql.SQLException
-
last
public boolean last() throws java.sql.SQLException
-
getRow
public int getRow() throws java.sql.SQLException
-
absolute
public boolean absolute(int idx) throws java.sql.SQLException
-
relative
public boolean relative(int rows) throws java.sql.SQLException
-
previous
public boolean previous() throws java.sql.SQLException
-
getFetchSize
public int getFetchSize()
-
setFetchSize
public void setFetchSize(int fetchSize) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-