Package java.sql

Examples of java.sql.Date


    Iterator iterator = createStrictMock(Iterator.class);
    OrderedProperty op = createStrictMock(OrderedProperty.class);
    MethodValidators methodValidators = createStrictMock(MethodValidators.class);
    Converter converter = createStrictMock(Converter.class);

    Date sqlDate = Date.valueOf("1999-12-12");
    simpleForm.setDateValue("1999-12-12");
    ValidationInfo vi = new ValidationInfo(validators, handler, new DefaultConversionHandler());

    expect(validators.keySet()).andReturn(keys);
    expect(keys.iterator()).andReturn(iterator);
    expect(iterator.hasNext()).andReturn(true);
    expect(iterator.next()).andReturn(op);
    expect(validators.get(op)).andReturn(methodValidators);
    expect(methodValidators.getRequiresConversion()).andReturn(true);
    expect(methodValidators.getConverter()).andReturn(converter);
    expect(op.getPropertyName()).andReturn("dateValue");
    expect(converter.toTargetType("1999-12-12")).andReturn(sqlDate);
    expect(methodValidators.getConverterType()).andReturn(sqlDate.getClass());
    expect(iterator.hasNext()).andReturn(false);

    HashMap<String, Object> map = new HashMap<String, Object>();
    map.put("dateValue", sqlDate);
View Full Code Here


    Iterator iterator = createStrictMock(Iterator.class);
    OrderedProperty op = createStrictMock(OrderedProperty.class);
    MethodValidators methodValidators = createStrictMock(MethodValidators.class);
    Converter converter = createStrictMock(Converter.class);

    Date sqlDate = Date.valueOf("1999-12-12");
    simpleForm.setDateValue("1999-12-12");
    ValidationInfo vi = new ValidationInfo(validators, handler, new DefaultConversionHandler());

    expect(validators.keySet()).andReturn(keys);
    expect(keys.iterator()).andReturn(iterator);
View Full Code Here

  public static Date convertTimeZone(Date dt, TimeZone currentTZ, TimeZone targetTZ)
  {
    GregorianCalendar gc = new GregorianCalendar(currentTZ);
    gc.setTime(dt);
    gc.setTimeZone(targetTZ);
    Date nts = new Date(gc.getTimeInMillis());
    return nts;
  }
View Full Code Here

      if (invID == 0) {
        inventoryVO = remote.insertInventory(individualID, inventoryVO);
        invenForm.setInventoryID(inventoryVO.getInventoryID());

        Timestamp timeStamp = inventoryVO.getModified();
        Date date = inventoryVO.getCreated();

        if (inventoryVO.getCreated() != null)
          invenForm.setCreated(dForm.format(date));

        if (inventoryVO.getModified() != null)
View Full Code Here

  }

  public static Date createDate(String year, String month, String day)
  {
    Timestamp ts = DateUtility.createTimestamp(year, month, day);
    return new Date(ts.getTime());
  }
View Full Code Here

  public void cancel()
  {
    message = "Ran cancel() method " + SimpleNavigableSubmitAction.class;
    helper.setStatusMessage(message);
    helper.addRequestParameter("cancelParam", new Date(System.currentTimeMillis()).toString());
  }
View Full Code Here

     * @return A <code>Date</code>
     */
   public static Date createDate(int year, int month, int date) {
        primeCalendar();
        CAL.get().set(year + 1900, month, date);
        return new Date(CAL.get().getTime().getTime());
   }
View Full Code Here

        expected = "1000"; //$NON-NLS-1$
        assertEquals(expected, getString(TestLiteralImpl.example(new Integer(1000))));
        expected = "TRUE"; //$NON-NLS-1$
        assertEquals(expected, getString(TestLiteralImpl.example(Boolean.TRUE)));
        long now = System.currentTimeMillis();
        Date date = new Date(now);
        expected = "{d '" + date.toString() + "'}"; //$NON-NLS-1$ //$NON-NLS-2$
        assertEquals(expected, getString(TestLiteralImpl.example(date)));
        Timestamp ts = new Timestamp(now);
        expected = "{ts '" + ts.toString() + "'}"; //$NON-NLS-1$ //$NON-NLS-2$
        assertEquals(expected, getString(TestLiteralImpl.example(ts)));
        Time t = new Time(now);
View Full Code Here

     * @param Calendar object used to construct the Date object.
     * @return The parameter at the given index is returned as a Date object.
     * @throws SQLException if param datatype is not DATE
     */
    public java.sql.Date getDate(int parameterIndex, Calendar cal) throws SQLException {
        Date value = DataTypeTransformer.getDate(getObject(parameterIndex));

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

        long time = target.getTimeInMillis();
       
        adjustCalendar(date, initial, target);
       
        Date result = normalizeDate(date, target);
       
        target.setTimeInMillis(time);
        return result;
    }
View Full Code Here

TOP

Related Classes of java.sql.Date

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.