Package org.hsqldb.types

Examples of org.hsqldb.types.Type$TypedComparator


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

        checkColumn(column);

        Type type = translateType(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 = translateType(resultMetaData.columnTypes[--column]);

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

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

        checkColumn(column);

        Type type = translateType(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      = translateType(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 = translateType(resultMetaData.columnTypes[--column]);

        return type.scale;
    }
View Full Code Here

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

        checkColumn(column);

        Type type = translateType(resultMetaData.columnTypes[--column]);

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

     */
    public String getColumnTypeName(int column) throws SQLException {

        checkColumn(column);

        Type type = translateType(resultMetaData.columnTypes[--column]);

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

     */
    public String getColumnClassName(int column) throws SQLException {

        checkColumn(column);

        Type type = translateType(resultMetaData.columnTypes[--column]);

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

     * added or removed. The adjust argument is {-1 | 0 | +1}
     */
    public final void moveData(Session session, PersistentStore other,
                               int colindex, int adjust) {

        Type   oldtype  = null;
        Type   newtype  = null;
        Object colvalue = null;

        if (adjust >= 0 && colindex != -1) {
            ColumnSchema column = ((Table) table).getColumn(colindex);

            colvalue = column.getDefaultValue(session);
            newtype  = ((Table) table).getColumnTypes()[colindex];
        }

        if (adjust <= 0 && colindex != -1) {
            oldtype = ((Table) other.getTable()).getColumnTypes()[colindex];
        }

        RowIterator it    = other.rowIterator();
        Table       table = (Table) this.table;

        try {
            while (it.hasNext()) {
                Row      row      = it.getNextRow();
                Object[] olddata  = row.getData();
                Object[] data     = table.getEmptyRowData();
                Object   oldvalue = null;

                if (adjust == 0 && colindex != -1) {
                    oldvalue = olddata[colindex];
                    colvalue = newtype.convertToType(session, oldvalue,
                                                     oldtype);
                }

                if (colvalue != null && newtype.isLobType()) {
                    session.sessionData.adjustLobUsageCount(colvalue, +1);
                }

                if (oldvalue != null && oldtype != null
                        && oldtype.isLobType()) {
View Full Code Here

        core.mainTable = t;
        core.mainIndex = index;
        core.mainCols  = index.getColumns();

        for (int i = 0; i < core.mainCols.length; i++) {
            Type dataType = t.getColumn(core.mainCols[i]).getDataType();

            if (dataType.isLobType()) {
                throw Error.error(ErrorCode.X_42534);
            }
        }
    }
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.