Package com.sas.rio

Class MVADualResultSet

java.lang.Object
com.sas.rio.MVAResultSet
com.sas.rio.MVADualResultSet
All Implemented Interfaces:
com.sas.sql.DualResultSet, AutoCloseable, ResultSet, Wrapper

public class MVADualResultSet extends MVAResultSet implements 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
  • Method Details

    • getMissingValue

      public com.sas.MissingValues getMissingValue(int columnIndex) throws 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:
      SQLException
    • getString

      public String getString(int columnIndex) throws 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 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:
      SQLException - This exception is thrown if the column value is not valid.
    • getString

      public String getString(String columnLabel) throws 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 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:
      SQLException - This exception is thrown if the column value is not valid.