Package org.hsqldb.types

Examples of org.hsqldb.types.TimestampData


    }

    protected TimestampData readTimestamp(Type type) throws IOException {

        if (type.typeCode == Types.SQL_TIMESTAMP) {
            return new TimestampData(readLong(), readInt());
        } else {
            return new TimestampData(readLong(), readInt(), readInt());
        }
    }
View Full Code Here


            long millis = HsqlDateTime.convertMillisFromCalendar(
                HsqlDateTime.tempCalDefault, dateTime.getTime());

            millis = HsqlDateTime.getNormalisedDate(millis);

            return new TimestampData(millis / 1000);
        }

        return scanner.newDate((String) value);
    }
View Full Code Here

                HsqlDateTime.tempCalDefault, dateTime.getTime());
            int nanos = dateTime.getNanos();

            nanos = ((DateTimeType) type).normaliseFraction(nanos, type.scale);

            return new TimestampData(millis / 1000, nanos, 0);
        }

        return scanner.newTimestamp((String) value);
    }
View Full Code Here

    protected TimestampData readDate(Type type) throws IOException {

        long date = readLong();

        return new TimestampData(date);
    }
View Full Code Here

    }

    protected TimestampData readTimestamp(Type type) throws IOException {

        if (type.typeCode == Types.SQL_TIMESTAMP) {
            return new TimestampData(readLong(), readInt());
        } else {
            return new TimestampData(readLong(), readInt(), readInt());
        }
    }
View Full Code Here

            }

            s              = sessions[i];
            row            = t.getEmptyRowData();
            row[isid]      = ValuePool.getLong(s.getId());
            row[ict]       = new TimestampData(s.getConnectTime() / 1000);
            row[iuname]    = s.getUsername();
            row[iis_admin] = ValuePool.getBoolean(s.isAdmin());
            row[iautocmt= s.sessionContext.isAutoCommit;
            row[ireadonly] = s.isReadOnlyDefault;
View Full Code Here

        return testValue;
    }

    protected TimestampData getOrAddDate(long longKey) {

        TimestampData testValue;
        int  hash       = (int) longKey ^ (int) (longKey >>> 32);
        int  index      = hashIndex.getHashIndex(hash);
        int  lookup     = hashIndex.hashTable[index];
        int  lastLookup = -1;

        for (; lookup >= 0;
                lastLookup = lookup,
                lookup = hashIndex.getNextLookup(lookup)) {
            testValue = (TimestampData) objectKeyTable[lookup];

            if (testValue.getSeconds() == longKey) {
                if (accessCount > ACCESS_MAX) {
                    resetAccessCount();
                }

                accessTable[lookup] = accessCount++;

                return testValue;
            }
        }

        if (hashIndex.elementCount >= threshold) {
            reset();

            return getOrAddDate(longKey);
        }

        lookup                 = hashIndex.linkNode(index, lastLookup);
        testValue              = new TimestampData(longKey);
        objectKeyTable[lookup] = testValue;

        if (accessCount > ACCESS_MAX) {
            resetAccessCount();
        }
View Full Code Here

            throw Error.error(ErrorCode.X_22007);
        }

        long seconds = HsqlDateTime.getDateSeconds(s);

        return new TimestampData(seconds);
    }
View Full Code Here

        if (hasZone) {
            seconds -= zoneSeconds;
        }

        return new TimestampData(seconds, fraction, (int) zoneSeconds);
    }
View Full Code Here

            case Types.SQL_TIMESTAMP_WITH_TIME_ZONE :
                break;
            default :
                throw Util.sqlException(ErrorCode.X_42561);
        }
        parameterValues[i] = new TimestampData((millis + zoneOffset) / 1000);
    }
View Full Code Here

TOP

Related Classes of org.hsqldb.types.TimestampData

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.