Package java.sql

Examples of java.sql.Time


        assertDatesEqual(orig, (Date) _mgr.copyDate(orig));

        orig = new java.sql.Date(1999);
        assertDatesEqual(orig, (Date) _mgr.copyDate(orig));

        orig = new Time(1999);
        assertDatesEqual(orig, (Date) _mgr.copyDate(orig));

        Timestamp torig = new Timestamp(1999);
        torig.setNanos(2001);
        assertDatesEqual(torig, (Date) _mgr.copyDate(torig));
View Full Code Here


    }

    public void testCopyProxyDate() {
        Date orig = (Date) _mgr.newDateProxy(Time.class);
        orig.setTime(1999);
        assertDatesEqual(new Time(orig.getTime()), (Date) _mgr.copyDate(orig));
    }
View Full Code Here

    }

    public void testCloneProxyDate() {
        Date orig = (Date) _mgr.newDateProxy(Time.class);
        orig.setTime(1999);
        assertDatesEquals(new Time(orig.getTime()), (Date) orig.clone());
    }
View Full Code Here

    clearDate();
  }

  // implement ZonelessDatetime
  public Object toJdbcObject() {
    return new Time(getJdbcTime(DateTimeUtil.DEFAULT_ZONE));
  }
View Full Code Here

   * {@link java.sql.Time#toString() toString()} method of that class.
   *
   * @return the formatted time string
   */
  public String toString() {
    Time jdbcTime = getTempTime(getJdbcTime(DateTimeUtil.DEFAULT_ZONE));
    return jdbcTime.toString();
  }
View Full Code Here

   * @param format format string, as required by SimpleDateFormat
   * @return the formatted time string
   */
  public String toString(String format) {
    DateFormat formatter = getFormatter(format);
    Time jdbcTime = getTempTime(getTime());
    return formatter.format(jdbcTime);
  }
View Full Code Here

  /**
   * Gets a temporary Time object. The same object is returned every time.
   */
  protected Time getTempTime(long value) {
    if (tempTime == null) {
      tempTime = new Time(value);
    } else {
      tempTime.setTime(value);
    }
    return tempTime;
  }
View Full Code Here

        testConversion(1.0d, 1.0d, Object.class);
        testConversion(1.0f, 1.0f, Object.class);
        testConversion(BigInteger.ONE, BigInteger.ONE, Object.class);
        testConversion(BigDecimal.ONE, BigDecimal.ONE, Object.class);
        testConversion(new Date(0), new Date(0), Object.class);
        testConversion(new Time(0), new Time(0), Object.class);
        testConversion(new Timestamp(0), new Timestamp(0), Object.class);
    }
View Full Code Here

        testConversion("1.0", 1.0d, String.class);
        testConversion("1.0", 1.0f, String.class);
        testConversion("1", BigInteger.ONE, String.class);
        testConversion("1", BigDecimal.ONE, String.class);
        testConversion(zeroDate(), new Date(0), String.class);
        testConversion(zeroTime(), new Time(0), String.class);
        testConversion(zeroTimestamp(), new Timestamp(0), String.class);
    }
View Full Code Here

        testConversion(false, BigInteger.ZERO, Boolean.class);
        testConversion(null, BigDecimal.TEN, Boolean.class);
        testConversion(true, BigDecimal.ONE, Boolean.class);
        testConversion(false, BigDecimal.ZERO, Boolean.class);
        testConversion(null, new Date(0), Boolean.class);
        testConversion(null, new Time(0), Boolean.class);
        testConversion(null, new Timestamp(0), Boolean.class);
    }
View Full Code Here

TOP

Related Classes of java.sql.Time

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.