Class UpdatableResult
java.lang.Object
org.mariadb.jdbc.client.result.Result
org.mariadb.jdbc.client.result.CompleteResult
org.mariadb.jdbc.client.result.UpdatableResult
- All Implemented Interfaces:
AutoCloseable, ResultSet, Wrapper, Completion, ServerMessage
Updatable result implementation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate Stringprivate Stringprivate booleanprivate ParameterListprivate String[]private intprivate Stringprivate intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate StringFields inherited from class CompleteResult
BEFORE_FIRST_POSFields inherited from class Result
closed, context, data, dataSize, exceptionFactory, fieldIndex, loaded, maxRows, metadataList, NULL_LENGTH, outputParameter, reader, resultSetType, rowBuf, rowDecoder, rowPointer, statement, traceEnableFields inherited from interface 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
ConstructorsConstructorDescriptionUpdatableResult(Statement stmt, boolean binaryProtocol, long maxRows, ColumnDecoder[] metadataList, Reader reader, Context context, int resultSetType, boolean closeOnCompletion, boolean traceEnable) Constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleanabsolute(int row) voidvoidprivate StringBuild insert queryvoidprivate voidcannotUpdateInsertRow(String reason) private voidprivate voidcheckUpdatable(int position) voidbooleanfirst()intvoidbooleanlast()voidvoidbooleannext()Position resultset to next rowprivate PreparedStatementbooleanprevious()private byte[]voidprivate Stringbooleanrelative(int rows) private voidbooleanbooleanbooleanvoidupdateArray(int columnIndex, Array x) voidupdateAsciiStream(int columnIndex, InputStream x) voidupdateAsciiStream(int columnIndex, InputStream x, int length) voidupdateAsciiStream(int columnIndex, InputStream x, long length) voidupdateAsciiStream(String columnLabel, InputStream x) voidupdateAsciiStream(String columnLabel, InputStream x, int length) voidupdateAsciiStream(String columnLabel, InputStream x, long length) voidupdateBigDecimal(int columnIndex, BigDecimal x) voidupdateBigDecimal(String columnLabel, BigDecimal x) voidupdateBinaryStream(int columnIndex, InputStream x) voidupdateBinaryStream(int columnIndex, InputStream x, int length) voidupdateBinaryStream(int columnIndex, InputStream x, long length) voidupdateBinaryStream(String columnLabel, InputStream x) voidupdateBinaryStream(String columnLabel, InputStream x, int length) voidupdateBinaryStream(String columnLabel, InputStream x, long length) voidupdateBlob(int columnIndex, InputStream x) voidupdateBlob(int columnIndex, InputStream x, long length) voidupdateBlob(int columnIndex, Blob x) voidupdateBlob(String columnLabel, InputStream inputStream) voidupdateBlob(String columnLabel, InputStream inputStream, long length) voidupdateBlob(String columnLabel, Blob x) voidupdateBoolean(int columnIndex, boolean x) voidupdateBoolean(String columnLabel, boolean x) voidupdateByte(int columnIndex, byte x) voidupdateByte(String columnLabel, byte x) voidupdateBytes(int columnIndex, byte[] x) voidupdateBytes(String columnLabel, byte[] x) voidupdateCharacterStream(int columnIndex, Reader x) voidupdateCharacterStream(int columnIndex, Reader x, int length) voidupdateCharacterStream(int columnIndex, Reader x, long length) voidupdateCharacterStream(String columnLabel, Reader reader) voidupdateCharacterStream(String columnLabel, Reader reader, int length) voidupdateCharacterStream(String columnLabel, Reader reader, long length) voidupdateClob(int columnIndex, Reader x) voidupdateClob(int columnIndex, Reader x, long length) voidupdateClob(int columnIndex, Clob x) voidupdateClob(String columnLabel, Reader reader) voidupdateClob(String columnLabel, Reader reader, long length) voidupdateClob(String columnLabel, Clob x) voidupdateDate(int columnIndex, Date x) voidupdateDate(String columnLabel, Date x) voidupdateDouble(int columnIndex, double x) voidupdateDouble(String columnLabel, double x) voidupdateFloat(int columnIndex, float x) voidupdateFloat(String columnLabel, float x) voidupdateInt(int columnIndex, int x) voidprivate voidupdateInternalObject(int columnIndex, Object x, Long scaleOrLength) voidupdateLong(int columnIndex, long x) voidupdateLong(String columnLabel, long x) voidupdateNCharacterStream(int columnIndex, Reader x) voidupdateNCharacterStream(int columnIndex, Reader x, long length) voidupdateNCharacterStream(String columnLabel, Reader reader) voidupdateNCharacterStream(String columnLabel, Reader reader, long length) voidupdateNClob(int columnIndex, Reader reader) voidupdateNClob(int columnIndex, Reader reader, long length) voidupdateNClob(int columnIndex, NClob nClob) voidupdateNClob(String columnLabel, Reader reader) voidupdateNClob(String columnLabel, Reader reader, long length) voidupdateNClob(String columnLabel, NClob nClob) voidupdateNString(int columnIndex, String nString) voidupdateNString(String columnLabel, String nString) voidupdateNull(int columnIndex) voidupdateNull(String columnLabel) voidupdateObject(int columnIndex, Object x) voidupdateObject(int columnIndex, Object x, int scaleOrLength) voidupdateObject(int columnIndex, Object x, SQLType targetSqlType) voidupdateObject(int columnIndex, Object x, SQLType targetSqlType, int scaleOrLength) voidupdateObject(String columnLabel, Object x) voidupdateObject(String columnLabel, Object x, int scaleOrLength) voidupdateObject(String columnLabel, Object x, SQLType targetSqlType) voidupdateObject(String columnLabel, Object x, SQLType targetSqlType, int scaleOrLength) private StringvoidvoidupdateShort(int columnIndex, short x) voidupdateShort(String columnLabel, short x) voidupdateString(int columnIndex, String x) voidupdateString(String columnLabel, String x) voidupdateTime(int columnIndex, Time x) voidupdateTime(String columnLabel, Time x) voidupdateTimestamp(int columnIndex, Timestamp x) voidupdateTimestamp(String columnLabel, Timestamp x) Methods inherited from class CompleteResult
closeFromStmtClose, createResultSet, createResultSet, fetchRemaining, getFetchSize, getRow, isAfterLast, isBulkResult, isFirst, isLast, newResultsetWithUseAliasAsName, setBulkResult, setFetchSize, streamingMethods inherited from class Result
abort, addRowData, checkClose, checkNotForwardOnly, clearWarnings, close, closeOnCompletion, 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, 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, isBeforeFirst, isClosed, isOutputParameter, isWrapperFor, loaded, readNext, setFetchDirection, setNullRowBuf, setRow, setStatement, skipRemaining, unwrap, updateArray, updateRef, updateRef, updateRowData, updateRowId, updateRowId, updateSQLXML, updateSQLXML, wasNull
-
Field Details
-
STATE_STANDARD
private static final int STATE_STANDARD- See Also:
-
STATE_UPDATE
private static final int STATE_UPDATE- See Also:
-
STATE_UPDATED
private static final int STATE_UPDATED- See Also:
-
STATE_INSERT
private static final int STATE_INSERT- See Also:
-
STATE_INSERTED
private static final int STATE_INSERTED- See Also:
-
database
-
table
-
canInsert
private boolean canInsert -
canUpdate
private boolean canUpdate -
sqlStateError
-
isAutoincrementPk
private boolean isAutoincrementPk -
savedRowPointer
private int savedRowPointer -
changeError
-
state
private int state -
parameters
-
-
-
Constructor Details
-
UpdatableResult
public UpdatableResult(Statement stmt, boolean binaryProtocol, long maxRows, ColumnDecoder[] metadataList, Reader reader, Context context, int resultSetType, boolean closeOnCompletion, boolean traceEnable) throws IOException, SQLException Constructor- Parameters:
stmt- statement that initiate this resultbinaryProtocol- are rows binary encodedmaxRows- maximum rowsmetadataList- columns metadatareader- packet readercontext- connection contextresultSetType- result-set typecloseOnCompletion- close on completiontraceEnable- must network exchanges be logged- Throws:
IOException- if any socket error occursSQLException- for other kind of error
-
-
Method Details
-
checkIfUpdatable
- Throws:
SQLException
-
cannotUpdateInsertRow
-
checkUpdatable
- Throws:
SQLException
-
rowUpdated
public boolean rowUpdated()- Specified by:
rowUpdatedin interfaceResultSet- Overrides:
rowUpdatedin classResult
-
rowInserted
public boolean rowInserted()- Specified by:
rowInsertedin interfaceResultSet- Overrides:
rowInsertedin classResult
-
rowDeleted
public boolean rowDeleted()- Specified by:
rowDeletedin interfaceResultSet- Overrides:
rowDeletedin classResult
-
updateNull
- Specified by:
updateNullin interfaceResultSet- Overrides:
updateNullin classResult- Throws:
SQLException
-
updateBoolean
- Specified by:
updateBooleanin interfaceResultSet- Overrides:
updateBooleanin classResult- Throws:
SQLException
-
updateByte
- Specified by:
updateBytein interfaceResultSet- Overrides:
updateBytein classResult- Throws:
SQLException
-
updateShort
- Specified by:
updateShortin interfaceResultSet- Overrides:
updateShortin classResult- Throws:
SQLException
-
updateInt
- Specified by:
updateIntin interfaceResultSet- Overrides:
updateIntin classResult- Throws:
SQLException
-
updateLong
- Specified by:
updateLongin interfaceResultSet- Overrides:
updateLongin classResult- Throws:
SQLException
-
updateFloat
- Specified by:
updateFloatin interfaceResultSet- Overrides:
updateFloatin classResult- Throws:
SQLException
-
updateDouble
- Specified by:
updateDoublein interfaceResultSet- Overrides:
updateDoublein classResult- Throws:
SQLException
-
updateBigDecimal
- Specified by:
updateBigDecimalin interfaceResultSet- Overrides:
updateBigDecimalin classResult- Throws:
SQLException
-
updateString
- Specified by:
updateStringin interfaceResultSet- Overrides:
updateStringin classResult- Throws:
SQLException
-
updateBytes
- Specified by:
updateBytesin interfaceResultSet- Overrides:
updateBytesin classResult- Throws:
SQLException
-
updateDate
- Specified by:
updateDatein interfaceResultSet- Overrides:
updateDatein classResult- Throws:
SQLException
-
updateTime
- Specified by:
updateTimein interfaceResultSet- Overrides:
updateTimein classResult- Throws:
SQLException
-
updateArray
- Specified by:
updateArrayin interfaceResultSet- Overrides:
updateArrayin classResult- Throws:
SQLException
-
updateTimestamp
- Specified by:
updateTimestampin interfaceResultSet- Overrides:
updateTimestampin classResult- Throws:
SQLException
-
updateAsciiStream
- Specified by:
updateAsciiStreamin interfaceResultSet- Overrides:
updateAsciiStreamin classResult- Throws:
SQLException
-
updateBinaryStream
- Specified by:
updateBinaryStreamin interfaceResultSet- Overrides:
updateBinaryStreamin classResult- Throws:
SQLException
-
updateCharacterStream
- Specified by:
updateCharacterStreamin interfaceResultSet- Overrides:
updateCharacterStreamin classResult- Throws:
SQLException
-
updateObject
- Specified by:
updateObjectin interfaceResultSet- Overrides:
updateObjectin classResult- Throws:
SQLException
-
updateObject
- Specified by:
updateObjectin interfaceResultSet- Overrides:
updateObjectin classResult- Throws:
SQLException
-
updateNull
- Specified by:
updateNullin interfaceResultSet- Overrides:
updateNullin classResult- Throws:
SQLException
-
updateBoolean
- Specified by:
updateBooleanin interfaceResultSet- Overrides:
updateBooleanin classResult- Throws:
SQLException
-
updateByte
- Specified by:
updateBytein interfaceResultSet- Overrides:
updateBytein classResult- Throws:
SQLException
-
updateShort
- Specified by:
updateShortin interfaceResultSet- Overrides:
updateShortin classResult- Throws:
SQLException
-
updateInt
- Specified by:
updateIntin interfaceResultSet- Overrides:
updateIntin classResult- Throws:
SQLException
-
updateLong
- Specified by:
updateLongin interfaceResultSet- Overrides:
updateLongin classResult- Throws:
SQLException
-
updateFloat
- Specified by:
updateFloatin interfaceResultSet- Overrides:
updateFloatin classResult- Throws:
SQLException
-
updateDouble
- Specified by:
updateDoublein interfaceResultSet- Overrides:
updateDoublein classResult- Throws:
SQLException
-
updateBigDecimal
- Specified by:
updateBigDecimalin interfaceResultSet- Overrides:
updateBigDecimalin classResult- Throws:
SQLException
-
updateString
- Specified by:
updateStringin interfaceResultSet- Overrides:
updateStringin classResult- Throws:
SQLException
-
updateBytes
- Specified by:
updateBytesin interfaceResultSet- Overrides:
updateBytesin classResult- Throws:
SQLException
-
updateDate
- Specified by:
updateDatein interfaceResultSet- Overrides:
updateDatein classResult- Throws:
SQLException
-
updateTime
- Specified by:
updateTimein interfaceResultSet- Overrides:
updateTimein classResult- Throws:
SQLException
-
updateTimestamp
- Specified by:
updateTimestampin interfaceResultSet- Overrides:
updateTimestampin classResult- Throws:
SQLException
-
updateAsciiStream
- Specified by:
updateAsciiStreamin interfaceResultSet- Overrides:
updateAsciiStreamin classResult- Throws:
SQLException
-
updateBinaryStream
- Specified by:
updateBinaryStreamin interfaceResultSet- Overrides:
updateBinaryStreamin classResult- Throws:
SQLException
-
updateCharacterStream
public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException - Specified by:
updateCharacterStreamin interfaceResultSet- Overrides:
updateCharacterStreamin classResult- Throws:
SQLException
-
updateObject
- Specified by:
updateObjectin interfaceResultSet- Overrides:
updateObjectin classResult- Throws:
SQLException
-
updateObject
- Specified by:
updateObjectin interfaceResultSet- Overrides:
updateObjectin classResult- Throws:
SQLException
-
insertRow
- Specified by:
insertRowin interfaceResultSet- Overrides:
insertRowin classResult- Throws:
SQLException
-
buildInsertQuery
Build insert query- Returns:
- insert sql
- Throws:
SQLException- exception
-
refreshStmt
-
prepareRefreshStmt
- Throws:
SQLException
-
refreshRawData
- Throws:
SQLException
-
updateQuery
-
updateRow
- Specified by:
updateRowin interfaceResultSet- Overrides:
updateRowin classResult- Throws:
SQLException
-
deleteRow
- Specified by:
deleteRowin interfaceResultSet- Overrides:
deleteRowin classResult- Throws:
SQLException
-
refreshRow
- Specified by:
refreshRowin interfaceResultSet- Overrides:
refreshRowin classResult- Throws:
SQLException
-
cancelRowUpdates
public void cancelRowUpdates()- Specified by:
cancelRowUpdatesin interfaceResultSet- Overrides:
cancelRowUpdatesin classResult
-
moveToInsertRow
- Specified by:
moveToInsertRowin interfaceResultSet- Overrides:
moveToInsertRowin classResult- Throws:
SQLException
-
moveToCurrentRow
public void moveToCurrentRow()- Specified by:
moveToCurrentRowin interfaceResultSet- Overrides:
moveToCurrentRowin classResult
-
updateBlob
- Specified by:
updateBlobin interfaceResultSet- Overrides:
updateBlobin classResult- Throws:
SQLException
-
updateBlob
- Specified by:
updateBlobin interfaceResultSet- Overrides:
updateBlobin classResult- Throws:
SQLException
-
updateClob
- Specified by:
updateClobin interfaceResultSet- Overrides:
updateClobin classResult- Throws:
SQLException
-
updateClob
- Specified by:
updateClobin interfaceResultSet- Overrides:
updateClobin classResult- Throws:
SQLException
-
updateNString
- Specified by:
updateNStringin interfaceResultSet- Overrides:
updateNStringin classResult- Throws:
SQLException
-
updateNString
- Specified by:
updateNStringin interfaceResultSet- Overrides:
updateNStringin classResult- Throws:
SQLException
-
updateNClob
- Specified by:
updateNClobin interfaceResultSet- Overrides:
updateNClobin classResult- Throws:
SQLException
-
updateNClob
- Specified by:
updateNClobin interfaceResultSet- Overrides:
updateNClobin classResult- Throws:
SQLException
-
updateNCharacterStream
- Specified by:
updateNCharacterStreamin interfaceResultSet- Overrides:
updateNCharacterStreamin classResult- Throws:
SQLException
-
updateNCharacterStream
public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException - Specified by:
updateNCharacterStreamin interfaceResultSet- Overrides:
updateNCharacterStreamin classResult- Throws:
SQLException
-
updateAsciiStream
- Specified by:
updateAsciiStreamin interfaceResultSet- Overrides:
updateAsciiStreamin classResult- Throws:
SQLException
-
updateBinaryStream
- Specified by:
updateBinaryStreamin interfaceResultSet- Overrides:
updateBinaryStreamin classResult- Throws:
SQLException
-
updateCharacterStream
- Specified by:
updateCharacterStreamin interfaceResultSet- Overrides:
updateCharacterStreamin classResult- Throws:
SQLException
-
updateAsciiStream
- Specified by:
updateAsciiStreamin interfaceResultSet- Overrides:
updateAsciiStreamin classResult- Throws:
SQLException
-
updateBinaryStream
- Specified by:
updateBinaryStreamin interfaceResultSet- Overrides:
updateBinaryStreamin classResult- Throws:
SQLException
-
updateCharacterStream
public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException - Specified by:
updateCharacterStreamin interfaceResultSet- Overrides:
updateCharacterStreamin classResult- Throws:
SQLException
-
updateBlob
- Specified by:
updateBlobin interfaceResultSet- Overrides:
updateBlobin classResult- Throws:
SQLException
-
updateBlob
public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException - Specified by:
updateBlobin interfaceResultSet- Overrides:
updateBlobin classResult- Throws:
SQLException
-
updateClob
- Specified by:
updateClobin interfaceResultSet- Overrides:
updateClobin classResult- Throws:
SQLException
-
updateClob
- Specified by:
updateClobin interfaceResultSet- Overrides:
updateClobin classResult- Throws:
SQLException
-
updateNClob
- Specified by:
updateNClobin interfaceResultSet- Overrides:
updateNClobin classResult- Throws:
SQLException
-
updateNClob
- Specified by:
updateNClobin interfaceResultSet- Overrides:
updateNClobin classResult- Throws:
SQLException
-
updateNCharacterStream
- Specified by:
updateNCharacterStreamin interfaceResultSet- Overrides:
updateNCharacterStreamin classResult- Throws:
SQLException
-
updateNCharacterStream
- Specified by:
updateNCharacterStreamin interfaceResultSet- Overrides:
updateNCharacterStreamin classResult- Throws:
SQLException
-
updateAsciiStream
- Specified by:
updateAsciiStreamin interfaceResultSet- Overrides:
updateAsciiStreamin classResult- Throws:
SQLException
-
updateBinaryStream
- Specified by:
updateBinaryStreamin interfaceResultSet- Overrides:
updateBinaryStreamin classResult- Throws:
SQLException
-
updateCharacterStream
- Specified by:
updateCharacterStreamin interfaceResultSet- Overrides:
updateCharacterStreamin classResult- Throws:
SQLException
-
updateAsciiStream
- Specified by:
updateAsciiStreamin interfaceResultSet- Overrides:
updateAsciiStreamin classResult- Throws:
SQLException
-
updateBinaryStream
- Specified by:
updateBinaryStreamin interfaceResultSet- Overrides:
updateBinaryStreamin classResult- Throws:
SQLException
-
updateCharacterStream
- Specified by:
updateCharacterStreamin interfaceResultSet- Overrides:
updateCharacterStreamin classResult- Throws:
SQLException
-
updateBlob
- Specified by:
updateBlobin interfaceResultSet- Overrides:
updateBlobin classResult- Throws:
SQLException
-
updateBlob
- Specified by:
updateBlobin interfaceResultSet- Overrides:
updateBlobin classResult- Throws:
SQLException
-
updateClob
- Specified by:
updateClobin interfaceResultSet- Overrides:
updateClobin classResult- Throws:
SQLException
-
updateClob
- Specified by:
updateClobin interfaceResultSet- Overrides:
updateClobin classResult- Throws:
SQLException
-
updateNClob
- Specified by:
updateNClobin interfaceResultSet- Overrides:
updateNClobin classResult- Throws:
SQLException
-
updateNClob
- Specified by:
updateNClobin interfaceResultSet- Overrides:
updateNClobin classResult- Throws:
SQLException
-
updateObject
public void updateObject(int columnIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException - Specified by:
updateObjectin interfaceResultSet- Overrides:
updateObjectin classResult- Throws:
SQLException
-
updateInternalObject
private void updateInternalObject(int columnIndex, Object x, Long scaleOrLength) throws SQLException - Throws:
SQLException
-
updateObject
public void updateObject(String columnLabel, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException - Specified by:
updateObjectin interfaceResultSet- Overrides:
updateObjectin classResult- Throws:
SQLException
-
updateObject
- Specified by:
updateObjectin interfaceResultSet- Overrides:
updateObjectin classResult- Throws:
SQLException
-
updateObject
- Specified by:
updateObjectin interfaceResultSet- Overrides:
updateObjectin classResult- Throws:
SQLException
-
getConcurrency
public int getConcurrency()- Specified by:
getConcurrencyin interfaceResultSet- Overrides:
getConcurrencyin classResult
-
resetToRowPointer
private void resetToRowPointer() -
beforeFirst
- Specified by:
beforeFirstin interfaceResultSet- Overrides:
beforeFirstin classCompleteResult- Throws:
SQLException
-
first
- Specified by:
firstin interfaceResultSet- Overrides:
firstin classCompleteResult- Throws:
SQLException
-
last
- Specified by:
lastin interfaceResultSet- Overrides:
lastin classCompleteResult- Throws:
SQLException
-
afterLast
- Specified by:
afterLastin interfaceResultSet- Overrides:
afterLastin classCompleteResult- Throws:
SQLException
-
absolute
- Specified by:
absolutein interfaceResultSet- Overrides:
absolutein classCompleteResult- Throws:
SQLException
-
relative
- Specified by:
relativein interfaceResultSet- Overrides:
relativein classCompleteResult- Throws:
SQLException
-
next
Description copied from class:ResultPosition resultset to next row- Specified by:
nextin interfaceResultSet- Overrides:
nextin classCompleteResult- Returns:
- true if next row exists
- Throws:
SQLException- if any error occurs
-
previous
- Specified by:
previousin interfaceResultSet- Overrides:
previousin classCompleteResult- Throws:
SQLException
-