Package org.hsqldb.types

Examples of org.hsqldb.types.TimestampData


            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


                break;
            default :
                throw Util.sqlException(ErrorCode.X_42561);
        }
        parameterValues[i] = new TimestampData(millis / 1000, x.getNanos(),
                zoneOffset / 1000);
    }
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

        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

        // Do it.
        for (int i = 0; i < sessions.length; i++) {
            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= ValuePool.getBoolean(s.isAutoCommit());
            row[ireadonly] = ValuePool.getBoolean(s.isReadOnlyDefault());
            row[ilast_id] =
View Full Code Here

    public TimestampData getCurrentDate() {

        long currentMillis = System.currentTimeMillis();
        long seconds = HsqlDateTime.getCurrentDateMillis(currentMillis) / 1000;

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

     * this method is called on a closed <code>CallableStatement</code>
     * @see #setDate
     */
    public synchronized Date getDate(int parameterIndex) throws SQLException {

        TimestampData t = (TimestampData) getColumnInType(parameterIndex,
            Type.SQL_DATE);

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

     * @see #setTimestamp
     */
    public synchronized Timestamp getTimestamp(
            int parameterIndex) throws SQLException {

        TimestampData t = (TimestampData) getColumnInType(parameterIndex,
            Type.SQL_TIMESTAMP);

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

     *      JDBCParameterMetaData)
     */
    public synchronized Date getDate(int parameterIndex,
                                     Calendar cal) throws SQLException {

        TimestampData t = (TimestampData) getColumnInType(parameterIndex,
            Type.SQL_DATE);

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

        long millis = t.getSeconds() * 1000;

        if (cal != null) {
            millis = HsqlDateTime.convertMillisToCalendar(cal, millis);
        }

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.