    All Packages    This Package  Previous  Next

# Class sqlj.runtime.profile.ref.RTStatementJDBCCallable

    java.lang.Object
       |
       +----sqlj.runtime.profile.ref.RTStatementJDBCBase
               |
               +----sqlj.runtime.profile.ref.RTStatementJDBCCallable

public class RTStatementJDBCCallable
extends RTStatementJDBCBase
implements RTStatement

This class implements the RTStatement interface using a JDBC callable statement. The superclass RTStatementJDBCBase handles all prepared statement related calls.

See Also:
  getStatementType

##

callableStmt
  The underlying JDBC callable statement with which this class is implemented

##

RTStatementJDBCCallable(CallableStatement)
  Creates a new statement object that uses the passed CallableStatement to implement its methods.

##

checkObjectClass(Object, Class)
  Verifies that the passed object can be assigned to an argument having the passed expected class type.
getBigDecimal(int)
  Fetches a BigDecimal from the underlying statement using `getObject`.
getBooleanNoNull(int)
  Fetches the result using the `getBoolean` method of the underlying statement.
getBooleanWrapper(int)
  Fetches a primitive type using the `getBoolean` method of the underlying statement.
getByteNoNull(int)
  Fetches the result using the `getByte` method of the underlying statement.
getBytes(int)
  Returns the result of calling the `getBytes` method on the underlying callable statement.
getByteWrapper(int)
  Fetches a primitive type using the `getByte` method of the underlying statement.
getDate(int)
  Returns the result of calling the `getDate` method on the underlying callable statement.
getDoubleNoNull(int)
  Fetches the result using the `getDouble` method of the underlying statement.
getDoubleWrapper(int)
  Fetches a primitive type using the `getDouble` method of the underlying statement.
getFloatNoNull(int)
  Fetches the result using the `getFloat` method of the underlying statement.
getFloatWrapper(int)
  Fetches a primitive type using the `getFloat` method of the underlying statement.
getIntNoNull(int)
  Fetches the result using the `getInt` method of the underlying statement.
getIntWrapper(int)
  Fetches a primitive type using the `getInt` method of the underlying statement.
getJDBCCallableStatement()
  Returns the underlying callable statement with which this object was created.
getLongNoNull(int)
  Fetches the result using the `getLong` method of the underlying statement.
getLongWrapper(int)
  Fetches a primitive type using the `getLong` method of the underlying statement.
getObject(int, Class)
  Fetches the object from the underlying statement using `getObject`.
getShortNoNull(int)
  Fetches the result using the `getShort` method of the underlying statement.
getShortWrapper(int)
  Fetches a primitive type using the `getShort` method of the underlying statement.
getString(int)
  Returns the result of calling the `getString` method on the underlying callable statement.
getTime(int)
  Returns the result of calling the `getTime` method on the underlying callable statement.
getTimestamp(int)
  Returns the result of calling the `getTimestamp` method on the underlying callable statement.
registerOutParameter(int, int)
  Calls `registerOutParameter` on the underlying callable statement.
registerOutParameters(EntryInfo)
  Registers the parameters on the underlying callable statement based on those described in the passed entry info object.

##

callableStmt

     protected CallableStatement callableStmt

  The underlying JDBC callable statement with which this class is implemented

##

RTStatementJDBCCallable

     public RTStatementJDBCCallable(CallableStatement callableStmt)

  Creates a new statement object that uses the passed CallableStatement to implement its methods.

  Parameters:
    callableStmt - the underlying JDBC callable statement

##

getJDBCCallableStatement

     public CallableStatement getJDBCCallableStatement()

  Returns the underlying callable statement with which this object was created. Note that unlike RTStatement, this method does not throw an exception since it always has a callable statement object.

registerOutParameters

     public void registerOutParameters(EntryInfo entryInfo) throws SQLException

  Registers the parameters on the underlying callable statement based on those described in the passed entry info object. For each OUT or INOUT parameter in the passed entry info object, `registerOutParameter` is called using the SQLType for that parameter.

  Parameters:
    entryInfo - the entry info object in which to find parameter information.
  Throws: SQLException
    if an error occurs during registration.
  See Also:
    getParamInfo, getMode, getSQLType

registerOutParameter

     public void registerOutParameter(int paramIndex,
                                      int sqlType) throws SQLException

  Calls `registerOutParameter` on the underlying callable statement.

  Throws: SQLException
    if an error occurs during the call.

getString

     public String getString(int parameterIndex) throws SQLException

  Returns the result of calling the `getString` method on the underlying callable statement.

  Throws: SQLException
    if an error is raised by the wrapped statement

getBytes

     public byte[] getBytes(int parameterIndex) throws SQLException

  Returns the result of calling the `getBytes` method on the underlying callable statement.

  Throws: SQLException
    if an error is raised by the wrapped statement

getDate

     public Date getDate(int parameterIndex) throws SQLException

  Returns the result of calling the `getDate` method on the underlying callable statement.

  Throws: SQLException
    if an error is raised by the wrapped statement

getTime

     public Time getTime(int parameterIndex) throws SQLException

  Returns the result of calling the `getTime` method on the underlying callable statement.

  Throws: SQLException
    if an error is raised by the wrapped statement

getTimestamp

     public Timestamp getTimestamp(int parameterIndex) throws SQLException

  Returns the result of calling the `getTimestamp` method on the underlying callable statement.

  Throws: SQLException
    if an error is raised by the wrapped statement

getBooleanNoNull

     public boolean getBooleanNoNull(int parameterIndex) throws SQLException

  Fetches the result using the `getBoolean` method of the underlying statement. If a subsequent call to `wasNull` returns true, a SQLNullException is raised. Otherwise the result is returned.

  Throws: SQLNullException
    if the parameter is null
  Throws: SQLException
    if an error occurs in the underlying statement

getByteNoNull

     public byte getByteNoNull(int parameterIndex) throws SQLException

  Fetches the result using the `getByte` method of the underlying statement. If a subsequent call to `wasNull` returns true, a SQLNullException is raised. Otherwise the result is returned.

  Throws: SQLNullException
    if the parameter is null
  Throws: SQLException
    if an error occurs in the underlying statement

getShortNoNull

     public short getShortNoNull(int parameterIndex) throws SQLException

  Fetches the result using the `getShort` method of the underlying statement. If a subsequent call to `wasNull` returns true, a SQLNullException is raised. Otherwise the result is returned.

  Throws: SQLNullException
    if the parameter is null
  Throws: SQLException
    if an error occurs in the underlying statement

getIntNoNull

     public int getIntNoNull(int parameterIndex) throws SQLException

  Fetches the result using the `getInt` method of the underlying statement. If a subsequent call to `wasNull` returns true, a SQLNullException is raised. Otherwise the result is returned.

  Throws: SQLNullException
    if the parameter is null
  Throws: SQLException
    if an error occurs in the underlying statement

getLongNoNull

     public long getLongNoNull(int parameterIndex) throws SQLException

  Fetches the result using the `getLong` method of the underlying statement. If a subsequent call to `wasNull` returns true, a SQLNullException is raised. Otherwise the result is returned.

  Throws: SQLNullException
    if the parameter is null
  Throws: SQLException
    if an error occurs in the underlying statement

getFloatNoNull

     public float getFloatNoNull(int parameterIndex) throws SQLException

  Fetches the result using the `getFloat` method of the underlying statement. If a subsequent call to `wasNull` returns true, a SQLNullException is raised. Otherwise the result is returned.

  Throws: SQLNullException
    if the parameter is null
  Throws: SQLException
    if an error occurs in the underlying statement

getDoubleNoNull

     public double getDoubleNoNull(int parameterIndex) throws SQLException

  Fetches the result using the `getDouble` method of the underlying statement. If a subsequent call to `wasNull` returns true, a SQLNullException is raised. Otherwise the result is returned.

  Throws: SQLNullException
    if the parameter is null
  Throws: SQLException
    if an error occurs in the underlying statement

getBooleanWrapper

     public Boolean getBooleanWrapper(int columnIndex) throws SQLException

  Fetches a primitive type using the `getBoolean` method of the underlying statement. If a subsequent call to `wasNull` returns true, null is returned. Otherwise the appropriate wrapper object is created and returned using the value of the fetched primitive type.

  Throws: SQLException
    if an error occurs in the underlying statement

getByteWrapper

     public Byte getByteWrapper(int columnIndex) throws SQLException

  Fetches a primitive type using the `getByte` method of the underlying statement. If a subsequent call to `wasNull` returns true, null is returned. Otherwise the appropriate wrapper object is created and returned using the value of the fetched primitive type.

  Throws: SQLException
    if an error occurs in the underlying statement

getShortWrapper

     public Short getShortWrapper(int columnIndex) throws SQLException

  Fetches a primitive type using the `getShort` method of the underlying statement. If a subsequent call to `wasNull` returns true, null is returned. Otherwise the appropriate wrapper object is created and returned using the value of the fetched primitive type.

  Throws: SQLException
    if an error occurs in the underlying statement

getIntWrapper

     public Integer getIntWrapper(int columnIndex) throws SQLException

  Fetches a primitive type using the `getInt` method of the underlying statement. If a subsequent call to `wasNull` returns true, null is returned. Otherwise the appropriate wrapper object is created and returned using the value of the fetched primitive type.

  Throws: SQLException
    if an error occurs in the underlying statement

getLongWrapper

     public Long getLongWrapper(int columnIndex) throws SQLException

  Fetches a primitive type using the `getLong` method of the underlying statement. If a subsequent call to `wasNull` returns true, null is returned. Otherwise the appropriate wrapper object is created and returned using the value of the fetched primitive type.

  Throws: SQLException
    if an error occurs in the underlying statement

getFloatWrapper

     public Float getFloatWrapper(int columnIndex) throws SQLException

  Fetches a primitive type using the `getFloat` method of the underlying statement. If a subsequent call to `wasNull` returns true, null is returned. Otherwise the appropriate wrapper object is created and returned using the value of the fetched primitive type.

  Throws: SQLException
    if an error occurs in the underlying statement

getDoubleWrapper

     public Double getDoubleWrapper(int columnIndex) throws SQLException

  Fetches a primitive type using the `getDouble` method of the underlying statement. If a subsequent call to `wasNull` returns true, null is returned. Otherwise the appropriate wrapper object is created and returned using the value of the fetched primitive type.

  Throws: SQLException
    if an error occurs in the underlying statement

getObject

     public Object getObject(int columnIndex,
                             Class objectType) throws SQLException

  Fetches the object from the underlying statement using `getObject`. Verifies that the object fetched can be assigned to an argument having the passed class object type.

  Throws: SQLException
    if an error occurs in the underlying statement, or the object has an incompatible type
  See Also:
    checkObjectClass

checkObjectClass

     public static void checkObjectClass(Object object,
                                         Class expectedType) throws SQLException

  Verifies that the passed object can be assigned to an argument having the passed expected class type. This is provided as a convenience for uniform error reporting in subclasses overriding the `getObject` method.

  If the passed object is null, no exception is raised.

  Parameters:
    object - the object to check
    expectedType - the class with which the object must be compatible
  Throws: SQLException
    if the object has an incompatible type

getBigDecimal

     public BigDecimal getBigDecimal(int columnIndex) throws SQLException

  Fetches a BigDecimal from the underlying statement using `getObject`.

  Throws: SQLException
    if an error occurs in the underlying statement, or the object has an incompatible type

    All Packages    This Package  Previous  Next