|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ricebridge.xmlman.in.XmlResultSet
Implementation of a ResultSet to present XML data.
This ResultSet provides much the same interface as a database ResultSet.
This implementation assumes that your data is fairly well behaved and attempts direct data type
conversions for methods like getInt(java.lang.String). Bad data will cause an exception to be thrown.
Refer to ResultSet for method documentation if none is given here.
NOTE: in order to reuse the
The Source Code of this Java class is available under a BSD-style license.
| Field Summary | |
protected ArrayList |
iData
Data as a List of String[] arrays. |
protected boolean |
iDataHasHeaders
The first line of the CSV file may contain headers. |
protected DateFormat |
iDateFormat
Default data format for date parsing. |
protected boolean |
iHeadersStored
Flag to indicate that headers have been loaded. |
protected String[] |
iRecord
Current data record. |
protected long |
iRecordIndex
index of current record. |
protected XmlResultSetMetaData |
iXmlRSMD
ResultSetMetaData provider |
| Fields inherited from interface java.sql.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 | |
XmlResultSet()
Support Class.newInstance() object instantiation. |
|
XmlResultSet(List pData)
Create a new ResultSet with specified a List of String[] arrays. |
|
| Method Summary | |
boolean |
absolute(int pRow)
|
void |
addRecord(String[] pRecord)
Set data for ResultSet. |
void |
afterLast()
|
void |
beforeFirst()
|
void |
cancelRowUpdates()
|
void |
clear()
Remove all data rows. |
void |
clearWarnings()
|
void |
close()
|
void |
deleteRow()
|
int |
findColumn(String pColumnName)
|
boolean |
first()
|
Array |
getArray(int pIndex)
|
Array |
getArray(String pColName)
|
InputStream |
getAsciiStream(int pColumnIndex)
|
InputStream |
getAsciiStream(String pColumnName)
|
BigDecimal |
getBigDecimal(int pColumnIndex)
|
BigDecimal |
getBigDecimal(int pColumnIndex,
int pScale)
|
BigDecimal |
getBigDecimal(String pColumnName)
|
BigDecimal |
getBigDecimal(String pColumnName,
int pScale)
|
InputStream |
getBinaryStream(int pColumnIndex)
|
InputStream |
getBinaryStream(String pColumnName)
|
Blob |
getBlob(int pIndex)
|
Blob |
getBlob(String pColName)
|
boolean |
getBoolean(int pColumnIndex)
|
boolean |
getBoolean(String pColumnName)
|
byte |
getByte(int pColumnIndex)
|
byte |
getByte(String pColumnName)
|
byte[] |
getBytes(int pColumnIndex)
|
byte[] |
getBytes(String pColumnName)
|
Reader |
getCharacterStream(int pColumnIndex)
|
Reader |
getCharacterStream(String pColumnName)
|
Clob |
getClob(int pIndex)
|
Clob |
getClob(String pColName)
|
int |
getConcurrency()
|
String |
getCursorName()
|
Date |
getDate(int pColumnIndex)
|
Date |
getDate(int pColumnIndex,
Calendar pCalendar)
ignores Calendar |
Date |
getDate(String pColumnName)
|
Date |
getDate(String pColumnName,
Calendar pCalendar)
|
double |
getDouble(int pColumnIndex)
|
double |
getDouble(String pColumnName)
|
int |
getFetchDirection()
|
int |
getFetchSize()
|
float |
getFloat(int pColumnIndex)
|
float |
getFloat(String pColumnName)
|
int |
getInt(int pColumnIndex)
|
int |
getInt(String pColumnName)
|
long |
getLong(int pColumnIndex)
|
long |
getLong(String pColumnName)
|
ResultSetMetaData |
getMetaData()
|
Object |
getObject(int pColumnIndex)
|
Object |
getObject(int pIndex,
Map pMap)
|
Object |
getObject(String pColumnName)
|
Object |
getObject(String pColName,
Map pMap)
|
Ref |
getRef(int pIndex)
|
Ref |
getRef(String pColName)
|
int |
getRow()
|
int |
getRowCount()
Get the number of rows. |
short |
getShort(int pColumnIndex)
|
short |
getShort(String pColumnName)
|
Statement |
getStatement()
|
String |
getString(int pColumnIndex)
|
String |
getString(String pColumnName)
|
Time |
getTime(int pColumnIndex)
|
Time |
getTime(int pColumnIndex,
Calendar pCalendar)
Note: ignores Calendar. |
Time |
getTime(String pColumnName)
|
Time |
getTime(String pColumnName,
Calendar pCalendar)
|
Timestamp |
getTimestamp(int pColumnIndex)
|
Timestamp |
getTimestamp(int pColumnIndex,
Calendar pCalendar)
Note: ignores Calendar. |
Timestamp |
getTimestamp(String pColumnName)
|
Timestamp |
getTimestamp(String pColumnName,
Calendar pCalendar)
|
int |
getType()
|
InputStream |
getUnicodeStream(int pColumnIndex)
|
InputStream |
getUnicodeStream(String pColumnName)
|
URL |
getURL(int pColumnIndex)
|
URL |
getURL(String pColumnName)
|
SQLWarning |
getWarnings()
|
void |
init()
Initialise the internal data containers before loading new XML record data. |
void |
insertRow()
|
boolean |
isAfterLast()
|
boolean |
isBeforeFirst()
|
boolean |
isFirst()
|
boolean |
isLast()
|
boolean |
last()
|
void |
moveToCurrentRow()
|
void |
moveToInsertRow()
|
protected boolean |
moveToLine()
Move to correct data line. |
boolean |
next()
|
boolean |
previous()
|
void |
refreshRow()
|
boolean |
relative(int pRows)
|
boolean |
rowDeleted()
|
boolean |
rowInserted()
|
boolean |
rowUpdated()
|
void |
setDataHasHeaders(boolean pDataHasHeaders)
The first record contains the column names. |
void |
setDateFormat(DateFormat pDateFormat)
Specify custom date format. |
void |
setFetchDirection(int pDirection)
|
void |
setFetchSize(int pRows)
|
void |
setHeaders(String[] pHeaders)
Set the column header names. |
String |
toString()
String description of object instance. |
void |
updateArray(int pColumnIndex,
Array pArray)
|
void |
updateArray(String pColumnName,
Array pArray)
|
void |
updateAsciiStream(int pColumnIndex,
InputStream pInputStream,
int pLength)
|
void |
updateAsciiStream(String pColumnName,
InputStream pInputStream,
int pLength)
|
void |
updateBigDecimal(int pColumnIndex,
BigDecimal pBigDecimal)
|
void |
updateBigDecimal(String pColumnName,
BigDecimal pBigDecimal)
|
void |
updateBinaryStream(int pColumnIndex,
InputStream pInputStream,
int pLength)
|
void |
updateBinaryStream(String pColumnName,
InputStream pInputStream,
int pLength)
|
void |
updateBlob(int pColumnIndex,
Blob pBlob)
|
void |
updateBlob(String pColumnName,
Blob pBlob)
|
void |
updateBoolean(int pColumnIndex,
boolean pValue)
|
void |
updateBoolean(String pColumnName,
boolean pValue)
|
void |
updateByte(int pColumnIndex,
byte pValue)
|
void |
updateByte(String pColumnName,
byte pValue)
|
void |
updateBytes(int pColumnIndex,
byte[] pBytes)
|
void |
updateBytes(String pColumnName,
byte[] pBytes)
|
void |
updateCharacterStream(int pColumnIndex,
Reader pReader,
int pLength)
|
void |
updateCharacterStream(String pColumnName,
Reader pReader,
int pLength)
|
void |
updateClob(int pColumnIndex,
Clob pValue)
|
void |
updateClob(String pColumnName,
Clob pValue)
|
void |
updateDate(int pColumnIndex,
Date pValue)
|
void |
updateDate(String pColumnName,
Date pValue)
|
void |
updateDouble(int pColumnIndex,
double pValue)
|
void |
updateDouble(String pColumnName,
double pValue)
|
void |
updateFloat(int pColumnIndex,
float pValue)
|
void |
updateFloat(String pColumnName,
float pValue)
|
void |
updateInt(int pColumnIndex,
int pValue)
|
void |
updateInt(String pColumnName,
int pValue)
|
void |
updateLong(int pColumnIndex,
long pValue)
|
void |
updateLong(String pColumnName,
long pValue)
|
void |
updateNull(int pColumnIndex)
|
void |
updateNull(String pColumnName)
|
void |
updateObject(int pColumnIndex,
Object pValue)
|
void |
updateObject(int pColumnIndex,
Object pValue,
int pScale)
|
void |
updateObject(String pColumnName,
Object pValue)
|
void |
updateObject(String pColumnName,
Object pValue,
int pScale)
|
void |
updateRef(int pColumnIndex,
Ref pValue)
|
void |
updateRef(String pColumnName,
Ref pValue)
|
void |
updateRow()
|
void |
updateShort(int pColumnIndex,
short pValue)
|
void |
updateShort(String pColumnName,
short pValue)
|
void |
updateString(int pColumnIndex,
String pValue)
|
void |
updateString(String pColumnName,
String pValue)
|
void |
updateTime(int pColumnIndex,
Time pValue)
|
void |
updateTime(String pColumnName,
Time pValue)
|
void |
updateTimestamp(int pColumnIndex,
Timestamp pValue)
|
void |
updateTimestamp(String pColumnName,
Timestamp pValue)
|
boolean |
wasNull()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected ArrayList iData
List of String[] arrays.
protected String[] iRecord
protected long iRecordIndex
protected DateFormat iDateFormat
protected XmlResultSetMetaData iXmlRSMD
protected boolean iDataHasHeaders
protected boolean iHeadersStored
| Constructor Detail |
public XmlResultSet()
Class.newInstance() object instantiation.
public XmlResultSet(List pData)
ResultSet with specified a List of String[] arrays.
| Method Detail |
public Array getArray(String pColName)
throws SQLException
getArray in interface ResultSetSQLException
public Array getArray(int pIndex)
throws SQLException
getArray in interface ResultSetSQLException
public Blob getBlob(String pColName)
throws SQLException
getBlob in interface ResultSetSQLException
public Blob getBlob(int pIndex)
throws SQLException
getBlob in interface ResultSetSQLException
public Clob getClob(String pColName)
throws SQLException
getClob in interface ResultSetSQLException
public Clob getClob(int pIndex)
throws SQLException
getClob in interface ResultSetSQLException
public Object getObject(String pColName,
Map pMap)
throws SQLException
getObject in interface ResultSetSQLException
public Object getObject(int pIndex,
Map pMap)
throws SQLException
getObject in interface ResultSetSQLException
public Ref getRef(String pColName)
throws SQLException
getRef in interface ResultSetSQLException
public Ref getRef(int pIndex)
throws SQLException
getRef in interface ResultSetSQLException
public Statement getStatement()
throws SQLException
getStatement in interface ResultSetSQLException
public SQLWarning getWarnings()
throws SQLException
getWarnings in interface ResultSetSQLException
public String getCursorName()
throws SQLException
getCursorName in interface ResultSetSQLException
public boolean rowDeleted()
throws SQLException
rowDeleted in interface ResultSetSQLException
public boolean rowInserted()
throws SQLException
rowInserted in interface ResultSetSQLException
public boolean rowUpdated()
throws SQLException
rowUpdated in interface ResultSetSQLException
public boolean wasNull()
throws SQLException
wasNull in interface ResultSetSQLException
public int getFetchDirection()
throws SQLException
getFetchDirection in interface ResultSetSQLException
public void setFetchDirection(int pDirection)
throws SQLException
setFetchDirection in interface ResultSetSQLException
public int getFetchSize()
throws SQLException
getFetchSize in interface ResultSetSQLException
public void setFetchSize(int pRows)
throws SQLException
setFetchSize in interface ResultSetSQLException
public int getConcurrency()
throws SQLException
getConcurrency in interface ResultSetSQLException
public void cancelRowUpdates()
throws SQLException
cancelRowUpdates in interface ResultSetSQLException
public void clearWarnings()
throws SQLException
clearWarnings in interface ResultSetSQLException
public void close()
throws SQLException
close in interface ResultSetSQLException
public void deleteRow()
throws SQLException
deleteRow in interface ResultSetSQLException
public void insertRow()
throws SQLException
insertRow in interface ResultSetSQLException
public void moveToCurrentRow()
throws SQLException
moveToCurrentRow in interface ResultSetSQLException
public void moveToInsertRow()
throws SQLException
moveToInsertRow in interface ResultSetSQLException
public void refreshRow()
throws SQLException
refreshRow in interface ResultSetSQLException
public void updateArray(String pColumnName,
Array pArray)
throws SQLException
updateArray in interface ResultSetSQLException
public void updateArray(int pColumnIndex,
Array pArray)
throws SQLException
updateArray in interface ResultSetSQLException
public void updateAsciiStream(String pColumnName,
InputStream pInputStream,
int pLength)
throws SQLException
updateAsciiStream in interface ResultSetSQLException
public void updateAsciiStream(int pColumnIndex,
InputStream pInputStream,
int pLength)
throws SQLException
updateAsciiStream in interface ResultSetSQLException
public void updateBigDecimal(String pColumnName,
BigDecimal pBigDecimal)
throws SQLException
updateBigDecimal in interface ResultSetSQLException
public void updateBigDecimal(int pColumnIndex,
BigDecimal pBigDecimal)
throws SQLException
updateBigDecimal in interface ResultSetSQLException
public void updateBinaryStream(String pColumnName,
InputStream pInputStream,
int pLength)
throws SQLException
updateBinaryStream in interface ResultSetSQLException
public void updateBinaryStream(int pColumnIndex,
InputStream pInputStream,
int pLength)
throws SQLException
updateBinaryStream in interface ResultSetSQLException
public void updateBlob(String pColumnName,
Blob pBlob)
throws