private Object getColumnInType(int columnIndex,
                                   Type targetType) throws SQLException {

        Type   sourceType;
        Object value;

        sourceType = parameterTypes[--columnIndex];
        value      = parameterValues[columnIndex];

        if (trackNull(value)) {
            return null;
        }

        if (sourceType.typeCode != targetType.typeCode) {
            try {
                value = targetType.convertToTypeJDBC(session, value,
                        sourceType);
            } catch (HsqlException e) {
                String stringValue =
                    (value instanceof Number || value instanceof String
                     || value instanceof java.util.Date) ? value.toString()
                        : "instance of " + value.getClass().getName();
                String msg = "from SQL type " + sourceType.getNameString()
                             + " to " + targetType.getJDBCClassName()
                             + ", value: " + stringValue;
                HsqlException err = Error.error(ErrorCode.X_42561, msg);

                throw Util.sqlException(err, e);
            }
        }

        return value;
    }
private Object getColumnInType ( int columnIndex , Type targetType ) throws SQLException { Type sourceType ; Object value ; sourceType = parameterTypes [ -- columnIndex ] ; value = parameterValues [ columnIndex ] ; if ( trackNull ( value ) ) { return null ; } if ( sourceType . typeCode != targetType . typeCode ) { try { value = targetType . convertToTypeJDBC ( session , value , sourceType ) ; } catch ( HsqlException e ) { String stringValue = ( value instanceof Number || value instanceof String || value instanceof java . util . Date ) ? value . toString ( ) : "instance of " + value . getClass ( ) . getName ( ) ; String msg = "from SQL type " + sourceType . getNameString ( ) + " to " + targetType . getJDBCClassName ( ) + ", value: " + stringValue ; HsqlException err = Error . error ( ErrorCode . X_42561 , msg ) ; throw Util . sqlException ( err , e ) ; } } return value ; }
Internal value converter. Similar to its counterpart in JDBCResultSet <p>

All trivially successful getXXX methods eventually go through this
method, converting if neccessary from the source type to the
requested type.  <p>

Conversion to the JDBC representation, if different, is handled by the
calling methods.

@param columnIndex of the column value for which to perform the
conversion
@param targetType the org.hsqldb_voltpatches.types.Type object for targetType
@return an Object of the requested targetType, representing the value of the
specified column
@throws SQLException when there is no rowData, the column index is
invalid, or the conversion cannot be performed