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


                HsqlDateTime.convertMillisFromCalendar(tempCalDefault,
                    dateTime.getTime());

            millis = HsqlDateTime.getNormalisedDate(millis);

            return new TimestampData(millis / 1000);
        }

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

                    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

            }

            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] = s.isAdmin() ? Boolean.TRUE
                                         : Boolean.FALSE;
            row[iautocmt= s.sessionContext.isAutoCommit;
            row[ireadonly] = s.isReadOnlyDefault;
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

     *    JDBCParameterMetaData)
     */
    public synchronized Timestamp getTimestamp(int parameterIndex,
            Calendar cal) throws SQLException {

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

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

        long millis = t.getSeconds() * 1000;

        if (!parameterMetaData.columnTypes[--parameterIndex]
                .isDateTimeTypeWithZone()) {
            Calendar calendar = cal == null ? session.getCalendar()
                    : cal;

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

        Timestamp ts = new Timestamp(millis);

        ts.setNanos(t.getNanos());

        return ts;
    }
View Full Code Here

        switch (outType.typeCode) {

            case Types.SQL_DATE :
            case Types.SQL_TIMESTAMP :
                parameterValues[i] = new TimestampData(millis / 1000);

                break;
            case Types.SQL_TIMESTAMP_WITH_TIME_ZONE :
                int zoneOffset = HsqlDateTime.getZoneMillis(calendar, millis);

                parameterValues[i] = new TimestampData(millis / 1000, 0,
                        zoneOffset / 1000);

                break;
            default :
                throw JDBCUtil.sqlException(ErrorCode.X_42561);
View Full Code Here

            case Types.SQL_TIMESTAMP_WITH_TIME_ZONE :
                zoneOffset = HsqlDateTime.getZoneMillis(calendar, millis);

            // fall through
            case Types.SQL_TIMESTAMP :
                parameterValues[i] = new TimestampData(millis / 1000,
                        x.getNanos(), zoneOffset / 1000);

                break;
            case Types.SQL_TIME :
                millis = HsqlDateTime.getNormalisedTime(millis);
                parameterValues[i] = new TimeData((int) (millis / 1000),
                        x.getNanos(), 0);

                break;
            case Types.SQL_TIME_WITH_TIME_ZONE :
                zoneOffset = HsqlDateTime.getZoneMillis(calendar, millis);
                parameterValues[i] = new TimeData((int) (millis / 1000),
                        x.getNanos(), zoneOffset / 1000);

                break;
            case Types.SQL_DATE :
                millis             = HsqlDateTime.getNormalisedDate(millis);
                parameterValues[i] = new TimestampData(millis / 1000);

                break;
            default :
                throw JDBCUtil.sqlException(ErrorCode.X_42561);
        }
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.