Package org.hsqldb.types

Examples of org.hsqldb.types.TimeData


                break;
            default :
                throw Util.sqlException(ErrorCode.X_42561);
        }
        parameterValues[i] = new TimeData((int) (millis / 1000), 0,
                zoneOffset / 1000);
    }
View Full Code Here


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

                break;
            case Types.SQL_TIME :
                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;
            default :
                throw Util.sqlException(ErrorCode.X_42561);
View Full Code Here

        if (hasZone) {
            seconds -= zoneSeconds;
        }

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

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

        TimeData t = (TimeData) getColumnInType(parameterIndex, Type.SQL_TIME);

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

View Full Code Here

     *    JDBCParameterMetaData)
     */
    public synchronized Time getTime(int parameterIndex,
                                     Calendar cal) throws SQLException {

        TimeData t = (TimeData) getColumnInType(parameterIndex, Type.SQL_TIME);

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

        long millis = DateTimeType.normaliseTime(t.getSeconds()) * 1000;

        if (!resultMetaData.columnTypes[--parameterIndex]
                .isDateTimeTypeWithZone()) {
            Calendar calendar = cal == null ? session.getCalendar()
                    : cal;
View Full Code Here

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

        TimeData t = (TimeData) getColumnInType(columnIndex, Type.SQL_TIME);

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

View Full Code Here

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

        TimeData t = (TimeData) getColumnInType(columnIndex, Type.SQL_TIME);

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

        long millis = DateTimeType.normaliseTime(t.getSeconds()) * 1000;

        if (!resultMetaData.columnTypes[--columnIndex]
                .isDateTimeTypeWithZone()) {
            Calendar calendar = cal == null ? session.getCalendar()
                    : cal;
View Full Code Here

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

            millis = HsqlDateTime.getNormalisedTime(millis);

            return new TimeData((int) millis / 1000, 0, 0);
        }

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

    }

    protected TimeData readTime(Type type) throws IOException {

        if (type.typeCode == Types.SQL_TIME) {
            return new TimeData(readInt(), readInt(), 0);
        } else {
            return new TimeData(readInt(), readInt(), readInt());
        }
    }
View Full Code Here

                int seconds =
                    (int) (HsqlDateTime.getNormalisedTime(currentMillis))
                    / 1000;
                int nanos = (int) (currentMillis % 1000) * 1000000;

                currentTime = new TimeData(seconds, nanos, getZoneSeconds());
            }

            return currentTime;
        } else {
            if (localTime == null) {
                int seconds =
                    (int) (HsqlDateTime.getNormalisedTime(
                        currentMillis + getZoneSeconds() * 1000)) / 1000;
                int nanos = (int) (currentMillis % 1000) * 1000000;

                localTime = new TimeData(seconds, nanos, 0);
            }

            return localTime;
        }
    }
View Full Code Here

TOP

Related Classes of org.hsqldb.types.TimeData

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.