Class WriteableRowSet
java.lang.Object
com.mcpdbwizard.pub.ReadOnlyRowSet
com.mcpdbwizard.pub.WriteableRowSet
Create a writableRowSet that is based on a ResultSet.
Copyright 2003-2026 ATB Consultancy Services Ltd (formerly Orinda Software Ltd, Dublin, Ireland)
Under normal circumstances MCPDBWizard users will have no reason to use this class directly - the generated code will use it.
- Version:
- 7
- Author:
- devteam@mcpdbwizard.com
-
Field Summary
Fields inherited from class com.mcpdbwizard.pub.ReadOnlyRowSet
colCount, columnDecimalPlaces, columnJavaDatatypes, columnLengths, columnNames, columnOracleDatatypeNames, currentRowNumber, downloadedFileDir, expireDate, hitMemLimit, hitRowLimit, keepFiles, keepLobs, minimumFreeMemoryBytes, objectUnloader, readOnlyRowSetData, rowCount, tempFilePrefix, tempFileSuffix, theLog, theNumberFormat, theTimestampFormat, underlyingOracleDatatypes, useByteArraysForLongsAndLOBS -
Constructor Summary
ConstructorsConstructorDescriptionWriteableRowSet(Object[] theData, String[] columnNames, String[] columnOracleDatatypeNames, int[] underlyingOracleDatatypes, int[] columnJavaDatatypes, long[] columnLengths, int[] columnDecimalPlaces, LogInterface theLog, File downloadedFileDir, boolean keepFiles) Create a ReadOnlyRowSet that is based on user defined data rather than a ResultSet.WriteableRowSet(ResultSet theResultSet, String theQuery, int maxRows, LogInterface theLog) Create a writableRowSet that is based on a ResultSet. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new row.voidDelete current rowvoidsetBoolean(int columnId, Boolean theValue) Set columncolumnIdas a native ISO-SQLBOOLEAN(23ai).voidsetBoolean(String theColumnName, Boolean theValue) Set columncolumnNameas a native ISO-SQLBOOLEAN(23ai).voidsetCurrentRow(Object[] currentRow) Update current row as an array of ObjectvoidsetJSON(int columnId, oracle.sql.json.OracleJsonValue theValue) Set columncolumnIdas a native OracleJSONvalue (21c+).voidSet columncolumnNameas a native OracleJSONvalue (21c+).voidSet columncolumnIdas a String.voidSet columncolumnIdas a String.voidsetVector(int columnId, double[] theValue) Set columncolumnIdas a native OracleVECTOR(23ai).voidSet columncolumnNameas a native OracleVECTOR(23ai).voidsetVectorBinary(int columnId, byte[] theValue) Set columncolumnIdas a binary (bit-packed) OracleVECTOR(23ai).voidsetVectorBinary(String theColumnName, byte[] theValue) Set columncolumnNameas a binary (bit-packed) OracleVECTOR(23ai).voidsetVectorSparse(int columnId, SparseVector theValue) Set columncolumnIdas a sparse OracleVECTOR(23ai).voidsetVectorSparse(String theColumnName, SparseVector theValue) Set columncolumnNameas a sparse OracleVECTOR(23ai).Methods inherited from class com.mcpdbwizard.pub.ReadOnlyRowSet
checkColumnName, checkRange, checkRows, convertNumberToString, convertTIMESTAMPLTZToDate, convertTIMESTAMPLTZToString, convertTIMESTAMPLTZToTimestamp, convertTIMESTAMPToDate, convertTimestampToString, convertTIMESTAMPToString, convertTIMESTAMPToTimestamp, convertTIMESTAMPTZToDate, convertTIMESTAMPTZToString, convertTIMESTAMPTZToTimestamp, createInvalidDatatypeCastException, deleteGeneratedFiles, first, getBFILE, getBFILE, getBigDecimal, getBigDecimal, getBLOB, getBLOB, getBoolean, getBoolean, getBooleanObj, getBooleanObj, getByte, getByte, getByteArray, getByteArray, getByteObj, getByteObj, getCharArray, getCharArray, getCLOB, getCLOB, getColumnId, getColumnName, getColumnNamesAsString, getColumnNamesAsStringArray, getColumnOracleDatatypeNames, getCurrentRow, getCurrentRowNumber, getDate, getDate, getDouble, getDouble, getDoubleObj, getDoubleObj, getExpireDate, getFile, getFile, getFloat, getFloat, getFloatObj, getFloatObj, getInt, getInt, getIntegerObj, getIntegerObj, getJSON, getJSON, getLong, getLong, getLongObj, getLongObj, getObject, getObject, getOpaque, getOpaque, getRowAsString, getShort, getShort, getShortObj, getShortObj, getString, getString, getTempFileSuffix, getTimestamp, getTimestamp, getTIMESTAMP, getTIMESTAMP, getTIMESTAMPLTZ, getTIMESTAMPLTZ, getTIMESTAMPTZ, getTIMESTAMPTZ, getVector, getVector, getVectorBinary, getVectorBinary, getVectorSparse, getVectorSparse, getWriteableRowSet, hasExpired, hitMemLimit, hitRowLimit, isNull, isNull, last, nextRow, prevRow, retainShallowestByIntColumn, setCurrentRowNumber, setExpireDate, setNumberFormat, setTempFileSuffix, setTimestampFormat, size, toString, unloadObject, width
-
Constructor Details
-
WriteableRowSet
public WriteableRowSet(ResultSet theResultSet, String theQuery, int maxRows, LogInterface theLog) throws CSException Create a writableRowSet that is based on a ResultSet.- Parameters:
theResultSet-theQuery-maxRows-theLog-- Throws:
CSException
-
WriteableRowSet
public WriteableRowSet(Object[] theData, String[] columnNames, String[] columnOracleDatatypeNames, int[] underlyingOracleDatatypes, int[] columnJavaDatatypes, long[] columnLengths, int[] columnDecimalPlaces, LogInterface theLog, File downloadedFileDir, boolean keepFiles) Create a ReadOnlyRowSet that is based on user defined data rather than a ResultSet.This constructor is used to create a rowset based on a set of parameters for a stored procedure call.
- Parameters:
theData- An array of Object that contains another array of Object. The inner arrays are all of the the same length and map to a row of columns.columnNames-columnOracleDatatypeNames-underlyingOracleDatatypes-columnJavaDatatypes-theLog-downloadedFileDir- A directory to keep files containing clobs and blobs
-
-
Method Details
-
setCurrentRow
Update current row as an array of Object- Parameters:
currentRow- A one dimensional Object array to store as the current row.- Throws:
CSNoDataInRowSetException- if the rowset is empty.
-
deleteCurrentRow
Delete current row- Throws:
CSNoDataInRowSetException- if the rowset is empty.
-
addNewRow
Add a new row. We assume that newRow is an array of Object whose structure exactly matches the existing rows- Parameters:
newRow- A one dimensional Object array to add as a new row.- Throws:
CSNoDataInRowSetException
-
setString
public void setString(String theColumnName, String theValue) throws CSInvalidColumnIdException, CSNoDataInRowSetException, CSDBInvalidDatatypeCastException, CSUnsupportedDatatypeException Set columncolumnIdas a String. Numbers will be formatted. Dates will be formatted according to theTimeStampFormat.- Parameters:
theColumnName- The name of the columntheValue- of column #columnId.- Throws:
CSInvalidColumnIdException- if columnId is not the id of a valid column. Column numbering starts at 0.CSNoDataInRowSetException- if there are no rows in this rowset.CSDBInvalidDatatypeCastException- if columnId is not of a data type that can be turned into a String.CSUnsupportedDatatypeException- if columnId is not of a data type that we support.
-
setString
public void setString(int columnId, String theValue) throws CSInvalidColumnIdException, CSNoDataInRowSetException, CSDBInvalidDatatypeCastException, CSUnsupportedDatatypeException Set columncolumnIdas a String. Numbers will be formatted. Dates will be formatted according to theTimeStampFormat.- Parameters:
columnId- The number of the column.theValue- value of column #columnId if it can be turned into a string.- Throws:
CSInvalidColumnIdException- if columnId is not the id of a valid column. Column numbering starts at 0.CSNoDataInRowSetException- if there are no rows in this rowset.CSDBInvalidDatatypeCastException- if columnId is not of a data type that can be turned into a String.CSUnsupportedDatatypeException- if columnId is not of a data type that we support.
-
setJSON
public void setJSON(String theColumnName, oracle.sql.json.OracleJsonValue theValue) throws CSInvalidColumnIdException, CSNoDataInRowSetException Set columncolumnNameas a native OracleJSONvalue (21c+).- Parameters:
theColumnName- The name of the column.theValue- The JSON document (may be null).- Throws:
CSInvalidColumnIdExceptionCSNoDataInRowSetException- Since:
- Oracle 21c
-
setJSON
public void setJSON(int columnId, oracle.sql.json.OracleJsonValue theValue) throws CSInvalidColumnIdException, CSNoDataInRowSetException Set columncolumnIdas a native OracleJSONvalue (21c+).- Parameters:
columnId- The number of the column.theValue- The JSON document (may be null).- Throws:
CSInvalidColumnIdExceptionCSNoDataInRowSetException- Since:
- Oracle 21c
-
setVector
public void setVector(String theColumnName, double[] theValue) throws CSInvalidColumnIdException, CSNoDataInRowSetException Set columncolumnNameas a native OracleVECTOR(23ai).- Parameters:
theColumnName- The name of the column.theValue- One element per dimension (may be null).- Throws:
CSInvalidColumnIdExceptionCSNoDataInRowSetException- Since:
- Oracle 23ai
-
setVector
public void setVector(int columnId, double[] theValue) throws CSInvalidColumnIdException, CSNoDataInRowSetException Set columncolumnIdas a native OracleVECTOR(23ai).- Parameters:
columnId- The number of the column.theValue- One element per dimension (may be null).- Throws:
CSInvalidColumnIdExceptionCSNoDataInRowSetException- Since:
- Oracle 23ai
-
setVectorBinary
public void setVectorBinary(String theColumnName, byte[] theValue) throws CSInvalidColumnIdException, CSNoDataInRowSetException Set columncolumnNameas a binary (bit-packed) OracleVECTOR(23ai). Distinct fromsetVector(String, double[])(dense FLOAT32/FLOAT64/INT8 vectors).- Parameters:
theColumnName- The name of the column.theValue- The packed vector bytes (n bits = n/8 bytes), may be null.- Throws:
CSInvalidColumnIdExceptionCSNoDataInRowSetException- Since:
- Oracle 23ai
-
setVectorBinary
public void setVectorBinary(int columnId, byte[] theValue) throws CSInvalidColumnIdException, CSNoDataInRowSetException Set columncolumnIdas a binary (bit-packed) OracleVECTOR(23ai).- Parameters:
columnId- The number of the column.theValue- The packed vector bytes (n bits = n/8 bytes), may be null.- Throws:
CSInvalidColumnIdExceptionCSNoDataInRowSetException- Since:
- Oracle 23ai
-
setVectorSparse
public void setVectorSparse(String theColumnName, SparseVector theValue) throws CSInvalidColumnIdException, CSNoDataInRowSetException Set columncolumnNameas a sparse OracleVECTOR(23ai). Distinct fromsetVector(String, double[])(dense) andsetVectorBinary(String, byte[])(binary): a sparse vector carries{length, indices, values}and is not densified.- Parameters:
theColumnName- The name of the column.theValue- The sparse vector (may be null).- Throws:
CSInvalidColumnIdExceptionCSNoDataInRowSetException- Since:
- Oracle 23ai
-
setVectorSparse
public void setVectorSparse(int columnId, SparseVector theValue) throws CSInvalidColumnIdException, CSNoDataInRowSetException Set columncolumnIdas a sparse OracleVECTOR(23ai).- Parameters:
columnId- The number of the column.theValue- The sparse vector (may be null).- Throws:
CSInvalidColumnIdExceptionCSNoDataInRowSetException- Since:
- Oracle 23ai
-
setBoolean
public void setBoolean(String theColumnName, Boolean theValue) throws CSInvalidColumnIdException, CSNoDataInRowSetException Set columncolumnNameas a native ISO-SQLBOOLEAN(23ai).- Parameters:
theColumnName- The name of the column.theValue- The boolean (may be null).- Throws:
CSInvalidColumnIdExceptionCSNoDataInRowSetException- Since:
- Oracle 23ai
-
setBoolean
public void setBoolean(int columnId, Boolean theValue) throws CSInvalidColumnIdException, CSNoDataInRowSetException Set columncolumnIdas a native ISO-SQLBOOLEAN(23ai).- Parameters:
columnId- The number of the column.theValue- The boolean (may be null).- Throws:
CSInvalidColumnIdExceptionCSNoDataInRowSetException- Since:
- Oracle 23ai
-