APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.rowset.internal

public Class InsertRow

extends BaseRow
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Imports
com.sun.rowset.JdbcRowSetResourceBundle, java.sql.*, javax.sql.*, java.io.*, java.util.*

A class used internally to manage a CachedRowSet object's insert row. This class keeps track of the number of columns in the insert row and which columns have had a value inserted. It provides methods for retrieving a column value, setting a column value, and finding out whether the insert row is complete.

Field Summary

Modifier and TypeField and Description
private int
cols

The number of columns in this InsertRow object.

private BitSet
colsInserted

An internal BitSet object used to keep track of the columns in this InsertRow object that have had a value inserted.

private JdbcRowSetResourceBundle
pack-priv static final long
Inherited from com.sun.rowset.internal.BaseRow:
origVals

Constructor Summary

AccessConstructor and Description
public
InsertRow(int
an int indicating the number of columns in this InsertRow object
numCols
)

Creates an InsertRow object initialized with the given number of columns, an array for keeping track of the original values in this insert row, and a BitSet object with the same number of bits as there are columns.

Method Summary

Modifier and TypeMethod and Description
public Object
getColumnObject(int
the column number of the value to be retrieved; the first column is 1
idx
)

Implements abstract com.sun.rowset.internal.BaseRow.getColumnObject.

Retrieves the value of the designated column in this InsertRow object.

public void
initInsertRow()

Clears all the bits in the internal BitSet object maintained by this InsertRow object.

public boolean

Returns:

true if this InsertRow object is complete; false otherwise
isCompleteRow
(RowSetMetaData
the RowSetMetaData object for the CachedRowSet object that maintains this InsertRow object
RowSetMD
)

Indicates whether this InsertRow object has a value for every column that cannot be null.

protected void
markColInserted(int
the number of the column to be marked as inserted; the first column is 1
col
)

Sets the bit in this InsertRow object's internal BitSet object that corresponds to the specified column in this InsertRow object.

private void
readObject(ObjectInputStream ois)

This method re populates the resBundle during the deserialization process

public void
setColumnObject(int
the number of the column in the insert row to be set; the first column is 1
idx
,
Object
the value to be set
val
)

Implements abstract com.sun.rowset.internal.BaseRow.setColumnObject.

Sets the element in this InsertRow object's internal array of original values that corresponds to the designated column with the given value.

Inherited from com.sun.rowset.internal.BaseRow:
getOrigRow

Field Detail

colsback to summary
private int cols

The number of columns in this InsertRow object.

colsInsertedback to summary
private BitSet colsInserted

An internal BitSet object used to keep track of the columns in this InsertRow object that have had a value inserted.

resBundleback to summary
private JdbcRowSetResourceBundle resBundle
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides com.sun.rowset.internal.BaseRow.serialVersionUID.

Constructor Detail

InsertRowback to summary
public InsertRow(int numCols)

Creates an InsertRow object initialized with the given number of columns, an array for keeping track of the original values in this insert row, and a BitSet object with the same number of bits as there are columns.

Parameters
numCols:int

an int indicating the number of columns in this InsertRow object

Method Detail

getColumnObjectback to summary
public Object getColumnObject(int idx) throws SQLException

Implements abstract com.sun.rowset.internal.BaseRow.getColumnObject.

Retrieves the value of the designated column in this InsertRow object. If no value has been inserted into the designated column, this method throws an SQLException.

Parameters
idx:int

the column number of the value to be retrieved; the first column is 1

Exceptions
SQLException:
if no value has been inserted into the designated column
initInsertRowback to summary
public void initInsertRow()

Clears all the bits in the internal BitSet object maintained by this InsertRow object. Clearing all the bits indicates that none of the columns have had a value inserted.

isCompleteRowback to summary
public boolean isCompleteRow(RowSetMetaData RowSetMD) throws SQLException

Indicates whether this InsertRow object has a value for every column that cannot be null.

Parameters
RowSetMD:RowSetMetaData

the RowSetMetaData object for the CachedRowSet object that maintains this InsertRow object

Returns:boolean

true if this InsertRow object is complete; false otherwise

Exceptions
SQLException:
if there is an error accessing data
markColInsertedback to summary
protected void markColInserted(int col)

Sets the bit in this InsertRow object's internal BitSet object that corresponds to the specified column in this InsertRow object. Setting a bit indicates that a value has been set.

Parameters
col:int

the number of the column to be marked as inserted; the first column is 1

readObjectback to summary
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException

This method re populates the resBundle during the deserialization process

setColumnObjectback to summary
public void setColumnObject(int idx, Object val)

Implements abstract com.sun.rowset.internal.BaseRow.setColumnObject.

Sets the element in this InsertRow object's internal array of original values that corresponds to the designated column with the given value. If the third argument is true, which means that the cursor is on the insert row, this InsertRow object's internal BitSet object is set so that the bit corresponding to the column being set is turned on.

Parameters
idx:int

the number of the column in the insert row to be set; the first column is 1

val:Object

the value to be set