com.sas.rio
Class MVADualResultSet

com.sas.rio.MVADualResultSet
All Implemented Interfaces:
com.sas.sql.DualResultSet, java.sql.ResultSet, java.sql.Wrapper

public class MVADualResultSet
implements java.sql.ResultSet, com.sas.sql.DualResultSet

A dual result set provides simultaneous access to unformatted and server-side formatted data. This behavior is different from the standard ResultSet, in which the JDBC driver does the conversion when a String representation is requested on a non-Sting data type.

Note, a dual result set can only be created by direct access to a SAS data set; a dual result set can not be formed by a SQL SELECT query.

Calling #getString returns the server-side formatted value. All other getters, including #getObject, return the unformatted value.

The following example shows how to create a MVADualResultSet given an open MVAStatement:

   MVADualResultSet mvaResultSet = mvaStatement.createDualResultSet(
      "WORK", "TESTDS", null, null);
   String s = mvaResultSet.getString(1); // get server side formatted value
   double d = mvaResultSet.getDouble(1); // get field as double precision
 

Since:
9.4

Field Summary
 
Fields inherited from class com.sas.rio.MVAResultSet
_concurrency, _type, _warnings, _wasNull, CHARACTER, DATE, DATETIME, initialFetchSize, INTEGER, m_columnCount, m_maxRows, m_rowCache, m_statement, MAX_FIELD_SIZE, MAYBE_INTEGER, NOSUBTYPE, NUMERIC, TIME
 
Method Summary
 com.sas.MissingValues getMissingValue(int columnIndex)
          Retrieves the value of the designated column in the current row of this MVADualResultSet object as an official official SAS missing value.
 java.lang.String getString(int columnIndex)
          Gets the value of a column in the current row as a Java String.
 java.lang.String getString(java.lang.String columnLabel)
          Gets the value of a column in the current row as a Java String.
 
Methods inherited from class com.sas.rio.MVAResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, close, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCache, getCharacterStream, getCharacterStream, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getMetaData, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, isWrapperFor, last, moveToCurrentRow, moveToInsertRow, next, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, unwrap, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
 

Method Detail

getMissingValue

public com.sas.MissingValues getMissingValue(int columnIndex)
                                      throws java.sql.SQLException
Retrieves the value of the designated column in the current row of this MVADualResultSet object as an official official SAS missing value.

This routine supports both numeric and character MissingValues.

If the field is not a SAS missing value, then null is returned.

Specified by:
getMissingValue in interface com.sas.sql.DualResultSet
Parameters:
columnIndex - the first column is 1, the second is 2, ...
Returns:
the MissingValues representation of the field
Throws:
java.sql.SQLException

getString

public java.lang.String getString(int columnIndex)
                           throws java.sql.SQLException
Description copied from class: MVAResultSet
Gets the value of a column in the current row as a Java String.

Specified by:
getString in interface com.sas.sql.DualResultSet
Specified by:
getString in interface java.sql.ResultSet
Overrides:
getString in class MVAResultSet
Parameters:
columnIndex - The first column is 1, the second is 2, and so on.
Returns:
The column value. If the value is SQL NULL, the result is null.
Throws:
java.sql.SQLException - This exception is thrown if the column value is not valid.

getString

public java.lang.String getString(java.lang.String columnLabel)
                           throws java.sql.SQLException
Description copied from class: MVAResultSet
Gets the value of a column in the current row as a Java String.

Specified by:
getString in interface com.sas.sql.DualResultSet
Specified by:
getString in interface java.sql.ResultSet
Overrides:
getString in class MVAResultSet
Parameters:
columnLabel - The name of the column that is returned by the ResultSetMetaData object.
Returns:
The column value. If the value is SQL NULL, then the result is NULL.
Throws:
java.sql.SQLException - This exception is thrown if the column value is not valid.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.