Package org.hsqldb_voltpatches.types

Examples of org.hsqldb_voltpatches.types.Type


            } else if (expr.getType() == OpTypes.TABLE_SUBQUERY) {
                Object[] values = expr.getRowValue(session);

                for (int j = 0; j < values.length; j++, i++) {
                    int colIndex = columnMap[i];
                    Type colType =
                        expr.subQuery.queryExpression.getMetaData()
                            .columnTypes[j];

                    data[colIndex] = colTypes[colIndex].convertToType(session,
                            values[j], colType);
View Full Code Here


     */
    public Object getObject(int columnIndex) throws SQLException {

        checkColumn(columnIndex);

        Type sourceType = resultMetaData.columnTypes[columnIndex - 1];

        switch (sourceType.typeCode) {

            case Types.SQL_DATE :
                return getDate(columnIndex);
View Full Code Here

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

        Object[] rowData = getCurrent();
        Type     sourceType;
        Object   value;

        checkColumn(columnIndex);

        sourceType = resultMetaData.columnTypes[--columnIndex];
        value      = rowData[columnIndex];

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

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

                Util.throwError(Error.error(ErrorCode.X_42561, msg));
            }
View Full Code Here

                break;
            }
        }

//#endif JAVA6
        Type from = Type.getDefaultType(Type.getHSQLDBTypeCode(fromType));
        Type to   = Type.getDefaultType(Type.getHSQLDBTypeCode(toType));

        if (from == null || to == null) {
            return false;
        }

        return to.canConvertFrom(from);
    }
View Full Code Here

     */
    public boolean isCaseSensitive(int column) throws SQLException {

        checkColumn(column);

        Type type = resultMetaData.columnTypes[--column];

        if (type.isCharacterType()) {
            return !((CharacterType) type).isCaseInsensitive();
        }

        return false;
    }
View Full Code Here

     */
    public boolean isCurrency(int column) throws SQLException {

        checkColumn(column);

        Type type = resultMetaData.columnTypes[--column];

        return (type.typeCode == Types.SQL_DECIMAL
                || type.typeCode == Types.SQL_NUMERIC) && type.scale > 0;
    }
View Full Code Here

     */
    public boolean isSigned(int column) throws SQLException {

        checkColumn(column);

        Type type = resultMetaData.columnTypes[--column];

        return type.isNumberType();
    }
View Full Code Here

     */
    public int getColumnDisplaySize(int column) throws SQLException {

        checkColumn(column);

        Type type = resultMetaData.columnTypes[--column];

        return type.displaySize();
    }
View Full Code Here

    public int getPrecision(int column) throws SQLException {

        checkColumn(column);

        // type in columnTypes overrides column type
        Type type      = resultMetaData.columnTypes[--column];
        long precision = type.precision;

        if (type.isDateTimeType() || type.isIntervalType()) {
            precision = type.displaySize();
        }

        if (precision > Integer.MAX_VALUE) {
            precision = Integer.MAX_VALUE;
        }
View Full Code Here

     * @return scale
     * @exception SQLException if a database access error occurs
     */
    public int getScale(int column) throws SQLException {

        Type type = resultMetaData.columnTypes[--column];

        return type.scale;
    }
View Full Code Here

TOP

Related Classes of org.hsqldb_voltpatches.types.Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.