Examples of TimestampData


Examples of org.hsqldb.types.TimestampData

     *    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 (!resultMetaData.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

Examples of org.hsqldb.types.TimestampData

     * @exception SQLException if a database access error occurs or this method is
     *            called on a closed result set
     */
    public Date getDate(int columnIndex) throws SQLException {

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

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

Examples of org.hsqldb.types.TimestampData

     * @exception SQLException if a database access error occurs or this method is
     *            called on a closed result set
     */
    public Timestamp getTimestamp(int columnIndex) throws SQLException {

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

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

Examples of org.hsqldb.types.TimestampData

     * @since JDK 1.2 (JDK 1.1.x developers: read the overview for
     *  JDBCResultSet)
     */
    public Date getDate(int columnIndex, Calendar cal) throws SQLException {

        TimestampData t = (TimestampData) getColumnInType(columnIndex,
            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

Examples of org.hsqldb.types.TimestampData

     *  JDBCResultSet)
     */
    public Timestamp getTimestamp(int columnIndex,
                                  Calendar cal) throws SQLException {

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

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

        long millis = t.getSeconds() * 1000;

        if (!resultMetaData.columnTypes[--columnIndex]
                .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

Examples of org.hsqldb.types.TimestampData

            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

Examples of org.hsqldb.types.TimestampData

                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

Examples of org.hsqldb.types.TimestampData

    protected TimestampData readDate(Type type) throws IOException {

        long date = readLong();

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

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

Examples of org.hsqldb.types.TimestampData

        if (withZone) {
            if (currentTimestamp == null) {
                int nanos = (int) (currentMillis % 1000) * 1000000;

                currentTimestamp = new TimestampData((currentMillis / 1000),
                                                     nanos, getZoneSeconds());
            }

            return currentTimestamp;
        } else {
            if (localTimestamp == null) {
                int nanos = (int) (currentMillis % 1000) * 1000000;

                localTimestamp = new TimestampData(currentMillis / 1000
                                                   + getZoneSeconds(), nanos,
                                                       0);
            }

            return localTimestamp;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.