Package org.hsqldb.types

Examples of org.hsqldb.types.Type$TypedComparator


     */
    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


    public java.io.Reader getCharacterStream(
            int columnIndex) throws SQLException {

        checkColumn(columnIndex);

        Type   sourceType = resultMetaData.columnTypes[columnIndex - 1];
        Object o          = getColumnInType(columnIndex, sourceType);

        if (o == null) {
            return null;
        }
View Full Code Here

     */
    public BigDecimal getBigDecimal(int columnIndex) throws SQLException {

        checkColumn(columnIndex);

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

        switch (targetType.typeCode) {
           case Types.SQL_NUMERIC :
           case Types.SQL_DECIMAL :
               break;
View Full Code Here

     */
    public Blob getBlob(int columnIndex) throws SQLException {

        checkColumn(columnIndex);

        Type   sourceType = resultMetaData.columnTypes[columnIndex - 1];
        Object o          = getColumnInType(columnIndex, sourceType);

        if (o == null) {
            return null;
        }
View Full Code Here

     */
    public Clob getClob(int columnIndex) throws SQLException {

        checkColumn(columnIndex);

        Type   sourceType = resultMetaData.columnTypes[columnIndex - 1];
        Object o          = getColumnInType(columnIndex, sourceType);

        if (o == null) {
            return null;
        }
View Full Code Here

     */
    public Array getArray(int columnIndex) throws SQLException {

        checkColumn(columnIndex);

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

        if (!type.isArrayType()) {
            throw Util.sqlException(ErrorCode.X_42561);
        }

        Object[] data = (Object[]) getCurrent()[columnIndex - 1];

        if (data == null) {
            return null;
        }

        return new JDBCArray(data, type.collectionBaseType(), type, connection);
    }
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

        final int base_type    = 6;
        Iterator it =
            database.schemaManager.databaseObjectIterator(SchemaObject.TYPE);

        while (it.hasNext()) {
            Type distinct = (Type) it.next();

            if (!distinct.isDistinctType()) {
                continue;
            }

            Object[] data = t.getEmptyRowData();
            Type     type = distinct;

            if (translateDTI) {
                if (type.isIntervalType()) {
                    type = CharacterType.getCharacterType(Types.SQL_VARCHAR,
                                                          type.displaySize());
                } else if (type.isDateTimeTypeWithZone()) {
                    type = ((DateTimeType) type).getDateTimeTypeWithoutZone();
                }
            }

            data[type_catalog] = database.getCatalogName().name;
            data[type_schema= distinct.getSchemaName().name;
            data[type_name]    = distinct.getName().name;
            data[class_name]   = type.getJDBCClassName();
            data[data_type]    = ValuePool.getInt(Types.DISTINCT);
            data[remarks]      = null;
            data[base_type]    = ValuePool.getInt(type.getJDBCTypeCode());

            t.insertSys(store, data);
        }

        return t;
View Full Code Here

     * @see java.sql.Types
     */
    public boolean supportsConvert(int fromType,
                                   int toType) throws SQLException {

        Type from =
            Type.getDefaultTypeWithSize(Type.getHSQLDBTypeCode(fromType));
        Type to = Type.getDefaultTypeWithSize(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 = translateType(resultMetaData.columnTypes[--column]);

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

        return false;
    }
View Full Code Here

TOP

Related Classes of org.hsqldb.types.Type$TypedComparator

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.