Package java.sql

Examples of java.sql.Timestamp


        assertEquals(1, getIsoWeek(parse("2012-01-08")));
        assertEquals(2, getIsoWeek(parse("2012-01-09")));
    }

    private static int getIsoYear(Date date) {
        Timestamp ts = new Timestamp(date.getTime());
        return DateTimeUtils.getIsoYear(ts);
    }
View Full Code Here


    if(bean.getContactInfo()!=null)
      user.setContactInfo((ContactInfo)bean.getContactInfo().clone());
    if(bean.getCount()!=null)
      user.setCount((CountInfo)bean.getCount().clone());
    user.setResume(bean.getResume());
    user.setRegTime(new Timestamp(bean.getRegTime().getTime()));
    if(bean.getLastTime()!=null)
      user.setLastTime(new Timestamp(bean.getLastTime().getTime()));
    user.setLastAddr(bean.getLastAddr());
    user.setStatus(bean.getStatus());
    user.setKeepDays(bean.getKeepDays());
    user.setOwnSiteId(bean.getOwnSiteId());
    user.setPortrait(bean.getPortrait());
View Full Code Here

          throw new RuntimeException(e);
        }
    }

    private List createRowWithTimestamp(String tsStr) {
        Timestamp ts = Timestamp.valueOf(tsStr);
        return Arrays.asList(new Object[] {
            new Integer(0), "a", new Integer(1), "a"//$NON-NLS-1$ //$NON-NLS-2$
            null, null, null, null, null, null, ts, null, null, null, null, null, null  
        });
    }
View Full Code Here

        sampleDataStringTimestamps(dataManager);

        Calendar cal = Calendar.getInstance();
        cal.set(2004, Calendar.DECEMBER, 31, 0, 0, 0);
        cal.set(Calendar.MILLISECOND, 0);
        Timestamp t1 = new Timestamp(cal.getTime().getTime());
        cal.clear();
        cal.set(2004, Calendar.AUGUST, 1, 0, 0, 0);
        cal.set(Calendar.MILLISECOND, 0);
        Timestamp t2 = new Timestamp(cal.getTime().getTime());
       
        // Create expected results
        List[] expected = new List[] {
            Arrays.asList(new Object[] { t1,   new Integer(1),     Boolean.TRUE,   null }),
            Arrays.asList(new Object[] { t2,   new Integer(2),     Boolean.FALSE,  new Double(0.0) }),
View Full Code Here

        Timestamp time = TimestampUtil.createTimestamp(100, 0, 2, 1, 2, 3, 4);
        helpInvokeMethod("dayOfYear", new Object[] { time }, new Integer(2)); //$NON-NLS-1$
    }
   
    @Test public void testInvokeMonth() {
        Timestamp time = TimestampUtil.createTimestamp(100, 0, 1, 1, 2, 3, 4);
        helpInvokeMethod("month", new Object[] { time }, new Integer(1)); //$NON-NLS-1$
    }
View Full Code Here

            helpInvokeMethod("monthName", new Object[] { time }, FunctionMethods.monthNames[i]); //$NON-NLS-1$
        }
    }
   
    @Test public void testInvokeMinute() {
        Timestamp time = TimestampUtil.createTimestamp(100, 0, 1, 1, 2, 3, 4);
        helpInvokeMethod("minute", new Object[] { time }, new Integer(2)); //$NON-NLS-1$
    }
View Full Code Here

        Timestamp time = TimestampUtil.createTimestamp(100, 0, 1, 1, 2, 3, 4);
        helpInvokeMethod("minute", new Object[] { time }, new Integer(2)); //$NON-NLS-1$
    }
   
    @Test public void testInvokeSecond() {
        Timestamp time = TimestampUtil.createTimestamp(100, 0, 1, 1, 2, 3, 4);
        helpInvokeMethod("second", new Object[] { time }, new Integer(3)); //$NON-NLS-1$
    }
View Full Code Here

        Timestamp time = TimestampUtil.createTimestamp(100, 0, 1, 1, 2, 3, 4);
        helpInvokeMethod("second", new Object[] { time }, new Integer(3)); //$NON-NLS-1$
    }
   
    @Test public void testInvokeWeek() {
        Timestamp time = TimestampUtil.createTimestamp(100, 0, 1, 1, 2, 3, 4);
        helpInvokeMethod("week", new Object[] { time }, new Integer(1)); //$NON-NLS-1$
    }
View Full Code Here

        Timestamp time = TimestampUtil.createTimestamp(100, 0, 1, 1, 2, 3, 4);
        helpInvokeMethod("week", new Object[] { time }, new Integer(1)); //$NON-NLS-1$
    }
   
    @Test public void testInvokeYear() {
        Timestamp time = TimestampUtil.createTimestamp(100, 0, 1, 1, 2, 3, 4);
        helpInvokeMethod("year", new Object[] { time }, new Integer(2000)); //$NON-NLS-1$
    }
View Full Code Here

        if(! (tsCreateFunction.getName().equalsIgnoreCase("timestampCreate"))) { //$NON-NLS-1$
            return criteria;
        }
       
        // Get timestamp literal and break into pieces
        Timestamp ts = (Timestamp) timestampConstant.getValue();
        String tsStr = ts.toString();
        Date date = Date.valueOf(tsStr.substring(0, 10));
        Time time = Time.valueOf(tsStr.substring(11, 19));
       
        // Get timestampCreate args
        Expression[] args = tsCreateFunction.getArgs();
View Full Code Here

TOP

Related Classes of java.sql.Timestamp

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.