Class SingleRowWriter

All Implemented Interfaces:
AutoCloseable, ResultSet, Wrapper

public class SingleRowWriter extends SingleRowResultSet
A single row, updateable ResultSet, specially made for functions and procedures that returns complex types or sets.

A TupleDesc must be passed to the constructor. After values have been written, the native pointer to a formed Tuple can be retrieved using getTupleAndClear().

Author:
Thomas Hallgren
  • Constructor Details

    • SingleRowWriter

      public SingleRowWriter(TupleDesc tupleDesc) throws SQLException
      Construct a SingleRowWriter given a descriptor of the tuple structure it should produce.
      Throws:
      SQLException
  • Method Details

    • getObjectValue

      protected Object getObjectValue(int columnIndex, Class<?> type) throws SQLException
      Returns the value most recently written in the current tuple at the specified index, or null if none has been written.
      Specified by:
      getObjectValue in class ObjectResultSet
      Throws:
      SQLException
    • rowUpdated

      public boolean rowUpdated() throws SQLException
      Returns true if the row contains any non null values since all values of the row are null initially.
      Throws:
      SQLException
    • updateObject

      public void updateObject(int columnIndex, Object x) throws SQLException
      Throws:
      SQLException
    • cancelRowUpdates

      public void cancelRowUpdates() throws SQLException
      Throws:
      SQLException
    • close

      public void close() throws SQLException
      Cancels all changes but doesn't really close the set.
      Throws:
      SQLException
    • copyRowFrom

      public void copyRowFrom(ResultSet rs) throws SQLException
      Throws:
      SQLException
    • getTupleAndClear

      public long getTupleAndClear() throws SQLException
      Creates a tuple from the current row values and then cancel all row updates to prepare for a new row. This method is called automatically by the trigger handler and should not be called in any other way.
      Returns:
      The native pointer of the Tuple reflecting the current row values.
      Throws:
      SQLException
    • getTupleDesc

      protected final TupleDesc getTupleDesc()
      Specified by:
      getTupleDesc in class SingleRowResultSet
    • isClosed

      public boolean isClosed() throws SQLException
      Throws:
      SQLException