Package java.sql

Examples of java.sql.Timestamp


        processPreparedStatement(sql, expected, dataManager, new DefaultCapabilitiesFinder(), FakeMetadataFactory.example1Cached(), Arrays.asList(blobFromFile("encoding.xml")));
    }
 
    @Test public void testXmlTableTypes() throws Exception {
        String sql = "select * from xmltable('/a' passing xmlparse(document '<a>2000-01-01T01:01:00.2-06:00</a>') columns x timestamp path 'xs:dateTime(./text())', y timestamp path '.') as x"; //$NON-NLS-1$
        Timestamp ts = TimestampUtil.createTimestamp(100, 0, 1, 1, 1, 0, 200000000);
        List<?>[] expected = new List<?>[] {
            Arrays.asList(ts, ts),
        };   
   
        process(sql, expected);
View Full Code Here


        this.executionContext = context;
    }
   
    public String toString() {
      if (!source && event == Event.NEW) {
        return "\tSTART USER COMMAND:\tstartTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\ttxID=" + transactionID + "\tsessionID=" + sessionID + "\tapplicationName=" + applicationName + "\tprincipal=" + principal + "\tvdbName=" + vdbName + "\tvdbVersion=" + vdbVersion + "\tsql=" + sql;  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
      }
      if (!source) {
        return "\t"+ event +" USER COMMAND:\tendTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\ttxID=" + transactionID + "\tsessionID=" + sessionID + "\tprincipal=" + principal + "\tvdbName=" + vdbName + "\tvdbVersion=" + vdbVersion + "\tfinalRowCount=" + rowCount;  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
      }
      if (event == Event.NEW) {
        return "\tSTART DATA SRC COMMAND:\tstartTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\tsourceCommandID="+ sourceCommandID + "\ttxID=" + transactionID + "\tmodelName="+ modelName + "\tconnectorBindingName=" + connectorBindingName + "\tsessionID=" + sessionID + "\tprincipal=" + principal + "\tsql=" + sql;  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
      }
    return "\t"+ event +" SRC COMMAND:\tendTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\tsourceCommandID="+ sourceCommandID + "\ttxID=" + transactionID + "\tmodelName="+ modelName + "\tconnectorBindingName=" + connectorBindingName + "\tsessionID=" + sessionID + "\tprincipal=" + principal + "\tfinalRowCount=" + rowCount;  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
    }
View Full Code Here

        rs.next();
        assertEquals("Hello", rs.getString("NAME"));
        assertEquals(-1, rs.getByte("XT"));
        BigDecimal bd = rs.getBigDecimal("XD");
        assertTrue(bd.equals(new BigDecimal("10.30")));
        Timestamp ts = rs.getTimestamp("XTS");
        String s = ts.toString();
        assertEquals("2001-02-03 11:22:33.4455", s);
        assertTrue(ts.equals(Timestamp.valueOf("2001-02-03 11:22:33.4455")));
        assertEquals(new byte[] { (byte) 255, (byte) 1, (byte) 2 }, rs.getBytes("XBY"));
        assertTrue(rs.getBoolean("XBO"));
        assertEquals(3000, rs.getShort("XSM"));
        assertEquals(1234567890123456789L, rs.getLong("XBI"));
        assertEquals("1122aa", rs.getString("XBL"));
View Full Code Here

   * @return
   */
  public static void incViewCount(int log_id, int incCount){
    commitNamedUpdate("INC_DIARY_VIEW_COUNT",
        new Object[] { new Integer(incCount),
            new Timestamp(System.currentTimeMillis()),
            new Integer(log_id) });
  }
View Full Code Here

      }
    }
   
    // �����û����������һ�η���ʱ���Լ����ʵ�ַ,ͬʱ��������״̬
    ubean.setLastAddr(req.getRemoteAddr());
    ubean.setLastTime(new Timestamp(System.currentTimeMillis()));
    ubean.setKeepDays(keepDays);
    ubean.setOnlineStatus(1);
    DLOGUserManager.update(ubean);

    // д��¼��Ϣ��cookie,��ʹ��session�����û�����
View Full Code Here

   * @return
   */
  public static int readNewMsgs(int userid) {
    return commitNamedUpdate("READ_MESSAGE", new Object[] {
        MessageBean.I_STATUS_READ,
        new Timestamp(System.currentTimeMillis()), new Integer(userid),
        MessageBean.I_STATUS_NEW });
  }
View Full Code Here

   * @return
   */
  public static boolean createUser(UserBean user){
    if(user == null)
      return false;
    Timestamp ct = new Timestamp(System.currentTimeMillis());
    user.setRegTime(ct);
    user.setLastTime(ct);
    user.setStatus(UserBean.STATUS_NORMAL);
    save(user);
    return true;
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

      Calendar calendar = new GregorianCalendar();

      if (eventDetails.getStartdate() != null)
      {
        Timestamp date = (Timestamp)eventDetails.getStartdate();
        calendar.setTimeInMillis(date.getTime());

        int[] hhmm = new int[2];
        hhmm[0] = calendar.get(Calendar.HOUR_OF_DAY);
        hhmm[1] = calendar.get(Calendar.MINUTE);

        String strTime = CVUtility.convertTime24HrsFormatToStr(hhmm);
        dynaForm.set("startmonth", Integer.toString(calendar.get(Calendar.MONTH) + 1));
        dynaForm.set("startday", Integer.toString(calendar.get(Calendar.DATE)));
        dynaForm.set("startyear", Integer.toString(calendar.get(Calendar.YEAR)));
        dynaForm.set("starttime", strTime);
      }

      if (eventDetails.getEnddate() != null)
      {
        Timestamp date = (Timestamp)eventDetails.getEnddate();
        calendar.setTimeInMillis(date.getTime());

        int[] hhmm = new int[2];
        hhmm[0] = calendar.get(Calendar.HOUR_OF_DAY);
        hhmm[1] = calendar.get(Calendar.MINUTE);

        String strTime = CVUtility.convertTime24HrsFormatToStr(hhmm);
        dynaForm.set("endmonth", Integer.toString(calendar.get(Calendar.MONTH) + 1));
        dynaForm.set("endday", Integer.toString(calendar.get(Calendar.DATE)));
        dynaForm.set("endyear", Integer.toString(calendar.get(Calendar.YEAR)));
        dynaForm.set("endtime", strTime);
      }

      if (eventDetails.getCreateddate() != null)
      {
        Timestamp date = (Timestamp)eventDetails.getCreateddate();
        calendar.setTimeInMillis(date.getTime());

        String month = getCalenderMonth(calendar.get(Calendar.MONTH) + 1);

        dynaForm.set("createddate", month + " " + Integer.toString(calendar.get(Calendar.DATE)) + ", " + Integer.toString(calendar.get(Calendar.YEAR)));
      }

      if (eventDetails.getModifieddate() != null)
      {
        Timestamp date = (Timestamp)eventDetails.getModifieddate();

        calendar.setTimeInMillis(date.getTime());

        String month = getCalenderMonth(calendar.get(Calendar.MONTH) + 1);

        dynaForm.set("modifieddate", month + " " + Integer.toString(calendar.get(Calendar.DATE)) + ", " + Integer.toString(calendar.get(Calendar.YEAR)));
      }
View Full Code Here

        int startday   = Integer.parseInt(day);
        int startmonth = Integer.parseInt(month) - 1;
        int startyear  = Integer.parseInt(year);
        GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone(timeZone));
        gc.set(startyear,startmonth,startday,0,0,0);
        return new  Timestamp(gc.getTimeInMillis());
    }
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.