com.rocketsoftware.mvapi.ResultSet
Class MVResultSet

java.lang.Object
  extended by com.rocketsoftware.mvapi.ResultSet.AbstractResultSet
      extended by com.rocketsoftware.mvapi.ResultSet.MVResultSet
All Implemented Interfaces:
java.sql.ResultSet
Direct Known Subclasses:
MVAPIResultSet

public class MVResultSet
extends AbstractResultSet

Provides an implementation of Java.sql.ResultSet for handling Multivalue result sets.


Field Summary
 
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
MVResultSet()
          Construct an empty MVResultSet.
MVResultSet(java.lang.String result)
          Construct an MVResultSet from the result string.
 
Method Summary
 void close()
          Closes the result set.
 boolean first()
          Moves the cursor to the first row in this ResultSet object.
 int getColumnCount()
          Returns the number of columns in the current result set.
 java.lang.String[] getColumns()
          Returns the column names in the current result set.
 java.lang.String getCurrentRow()
          Returns the current row.
 int getRow()
          Retrieves the current row number.
 int getRowCount()
          Returns the number of rows in this result set.
 java.lang.String[] getRows()
          Returns the result set.
 java.lang.String getString(int columnIndex)
          Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.
 java.lang.String getString(java.lang.String columnName)
          Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.
 boolean isQuery()
          Returns true if this result set has been generated from an AQL query.
 boolean next()
          Moves the cursor down one row from its current position.
 void setResults(java.lang.String result)
          Populates the result set from the result string.
 
Methods inherited from class com.rocketsoftware.mvapi.ResultSet.AbstractResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, findColumn, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getInt, getInt, getLong, getLong, getMetaData, getObject, getObject, getObject, getObject, getRef, getRef, getShort, getShort, getStatement, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateShort, updateShort, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MVResultSet

public MVResultSet()
Construct an empty MVResultSet.


MVResultSet

public MVResultSet(java.lang.String result)
            throws MVException
Construct an MVResultSet from the result string.

Parameters:
result - an Attribute mark delimited string.

Each attribute in the result string will generate one row in the MVResultSet.

Throws:
MVException
Method Detail

next

public boolean next()
             throws MVException
Moves the cursor down one row from its current position. A ResultSet cursor is initially positioned before the first row; the first call to the method next makes the first row the current row; the second call makes the second row the current row, and so on.

Specified by:
next in interface java.sql.ResultSet
Overrides:
next in class AbstractResultSet
Returns:
true if the new current row is valid; false if there are no more rows
Throws:
MVException - if a database access error occurs

close

public void close()
           throws MVException
Closes the result set.

Specified by:
close in interface java.sql.ResultSet
Overrides:
close in class AbstractResultSet
Throws:
MVException - if a database access error occurs

getString

public java.lang.String getString(java.lang.String columnName)
                           throws MVException
Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.

Specified by:
getString in interface java.sql.ResultSet
Overrides:
getString in class AbstractResultSet
Parameters:
columnName - the Column name
Returns:
the column value
Throws:
MVException - if current row is not valid

getString

public java.lang.String getString(int columnIndex)
                           throws MVException
Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.

Specified by:
getString in interface java.sql.ResultSet
Overrides:
getString in class AbstractResultSet
Parameters:
columnIndex - the first column is 1, the second is 2, ...
Returns:
the column value
Throws:
MVException - if current row is not valid

first

public boolean first()
              throws MVException
Moves the cursor to the first row in this ResultSet object.

Specified by:
first in interface java.sql.ResultSet
Overrides:
first in class AbstractResultSet
Returns:
true if the cursor is on a valid row; false if there are no rows in the result set
Throws:
MVException - if any errors occur

getRow

public int getRow()
           throws MVException
Retrieves the current row number. The first row is number 0, the second number 1, and so on.

Specified by:
getRow in interface java.sql.ResultSet
Overrides:
getRow in class AbstractResultSet
Returns:
the current row number
Throws:
MVException - if any errors occur

setResults

public void setResults(java.lang.String result)
                throws MVException
Populates the result set from the result string.

Parameters:
result - an Attribute mark delimited string

Each attribute in the result string will generate one row in the MVResultSet.

Throws:
MVException - if any errors occur

getRowCount

public int getRowCount()
Returns the number of rows in this result set.

Returns:
row count.

getRows

public java.lang.String[] getRows()
Returns the result set.

Returns:
string array representing the row contents

getCurrentRow

public java.lang.String getCurrentRow()
                               throws MVException
Returns the current row.

Returns:
string the current row
Throws:
MVException - if any errors occur

getColumnCount

public int getColumnCount()
Returns the number of columns in the current result set.

Returns:
count of columns in result set

getColumns

public java.lang.String[] getColumns()
Returns the column names in the current result set.

Returns:
string array containing column names

isQuery

public boolean isQuery()
Returns true if this result set has been generated from an AQL query.

Returns:
true if generated from an AQL query.