public class Row extends MetaDataProvider implements DataRow
Title: Structured Data Object Row
Description: An object that describes a data row, a sequence of tuples (name=value pairs).
Copyright: Copyright (c) 2010
Company: StreamScape Technologies
DEFAULT_SERIAL_VERSION_ID
Constructor and Description |
---|
Row(ResultSet result)
Creates new row from the ResultSet.
|
Row(RowMetaData descriptor)
Creates new row with the specified meta data.
|
Row(RowMetaData meta,
java.lang.Object[] values)
Creates new row with the specified meta data and values.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Resets all columns to null values.
|
Row |
clone()
Clones the object.
|
int |
findColumn(java.lang.String columnName)
Returns index of the column with specified name.
|
java.lang.Object |
getColumn(int index)
Returns value of the column specified by index.
|
java.lang.Object |
getColumn(java.lang.String name)
Returns value of the column with specified name.
|
java.lang.Class |
getColumnClass(int index)
Returns Java type for the column with specified index.
|
java.lang.Class |
getColumnClass(java.lang.String columnName)
Returns Java type for the specified column.
|
int |
getColumnCount()
Returns column count.
|
int |
getColumnSQLType(int index)
Returns SQL type code for the column with specified index.
|
int |
getColumnSQLType(java.lang.String columnName)
Returns SQL type code for the specified column.
|
RowMetaData |
getMeta()
Returns meta data of the row.
|
RowMetaData |
getMetaData()
Returns clone of the meta data for the row.
|
java.lang.Object[] |
getRawData()
Returns array of values which represent row column values.
|
boolean |
hasRowId()
Checks if the row contains RowId.
|
boolean |
isColumnNull(int index)
Checks if column with specified index is NULL.
|
boolean |
isColumnNull(java.lang.String columnName)
Checks if specified column is NULL.
|
java.util.Iterator |
iterator()
Returns iterator for all column values.
|
void |
setColumn(int index,
java.lang.Object value)
Sets the value for the column specified by index.
|
void |
setColumn(java.lang.String columnName,
java.lang.Object value)
Sets the value for the column specified by name.
|
void |
setColumnNull(int index)
Sets column with specified index to NULL.
|
void |
setRawColumn(int index,
java.lang.Object value)
Sets raw data for this column.
|
void |
setRawData(java.lang.Object[] data)
Sets raw data for this row.
|
getSerialVersionUID
public Row(RowMetaData meta, java.lang.Object[] values) throws RowException
meta
- values
- RowException
- is thrown if provided values do not match to the meta data.public Row(RowMetaData descriptor)
descriptor
- public Row(ResultSet result) throws SecurityViolationException, SQLException, MetaDataException, RowException
result
- SecurityViolationException
SQLException
MetaDataException
RowException
public RowMetaData getMeta()
public RowMetaData getMetaData()
getMetaData
in interface DataRow
public void setRawData(java.lang.Object[] data) throws RowException
setRawData
in interface DataRow
data
- Array of values which represent columns of the row.RowException
- if provided array is null or number of
elements does not match columns count.public void setRawColumn(int index, java.lang.Object value) throws RowException
data
- Array of values which represent columns of the row.RowException
- if provided array is null or number of
elements does not match columns count.public java.lang.Object[] getRawData()
getRawData
in interface DataRow
public void setColumn(int index, java.lang.Object value) throws RowException
setColumn
in interface DataRow
index
- - column indexvalue
- - value which is supposed to be setRowException
- if provided index is out of rangepublic void setColumn(java.lang.String columnName, java.lang.Object value) throws RowException
setColumn
in interface DataRow
columnName
- - column namevalue
- - value which is supposed to be setRowException
- if column with specified name does not existpublic java.lang.Object getColumn(int index) throws RowException
getColumn
in interface DataRow
index
- of the columnRowException
- if specified index is out of rangepublic java.lang.Object getColumn(java.lang.String name) throws RowException
getColumn
in interface DataRow
name
- of the columnRowException
- if specified index is out of rangepublic int findColumn(java.lang.String columnName) throws RowException
findColumn
in interface DataRow
columnName
- StringRowException
public java.lang.Class getColumnClass(java.lang.String columnName) throws RowException
columnName
- RowException
public java.lang.Class getColumnClass(int index) throws RowException
getColumnClass
in interface DataRow
index
- intRowException
public int getColumnSQLType(java.lang.String columnName) throws RowException
columnName
- RowException
public void clear()
public boolean isColumnNull(int index) throws RowException
isColumnNull
in interface DataRow
index
- intRowException
public boolean isColumnNull(java.lang.String columnName) throws RowException
isColumnNull
in interface DataRow
columnName
- StringRowException
public int getColumnCount() throws RowException
getColumnCount
in interface DataRow
RowException
public int getColumnSQLType(int index) throws RowException
getColumnSQLType
in interface DataRow
index
- intRowException
public boolean hasRowId() throws RowException
hasRowId
in interface DataRow
RowException
public java.util.Iterator iterator()
public void setColumnNull(int index) throws RowException
setColumnNull
in interface DataRow
index
- intRowException
- if specified index is out of rangepublic Row clone()
CloneableDataObject
clone
in interface CloneableObject
clone
in class CloneableDataObject
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.