Package java.sql

Examples of java.sql.Timestamp


      oForm.setStageid(new Integer(oVO.getStageID()).toString());
      oForm.setStatusid(new Integer(oVO.getStatusID()).toString());
      oForm.setSourcename(oVO.getSource());
     
      if (oVO.getEstimatedClose() != null) {
        Timestamp date = (Timestamp)oVO.getEstimatedClose();
        String strMonth = String.valueOf(date.getMonth() + 1);
        String strDay = String.valueOf(date.getDate());
        String strYear = String.valueOf(date.getYear() + 1900);
        oForm.setEstimatedcloseday(strDay);
        oForm.setEstimatedclosemonth(strMonth);
        oForm.setEstimatedcloseyear(strYear);
      }
     
      if (oVO.getActualclose() != null) {
        Timestamp date = (Timestamp)oVO.getActualclose();
        String strMonth = String.valueOf(date.getMonth() + 1);
        String strDay = String.valueOf(date.getDate());
        String strYear = String.valueOf(date.getYear() + 1900);
        oForm.setActualcloseday(strDay);
        oForm.setActualclosemonth(strMonth);
        oForm.setActualcloseyear(strYear);
      }
     
      oForm.setOpportunitytypeid((new Integer(oVO.getOpportunityTypeID())).toString());
      oForm.setProbabilityid((new Integer(oVO.getProbability())).toString());
      DecimalFormat currencyFormat = new DecimalFormat("###,###,##0.00");
      String actualAmount = currencyFormat.format(oVO.getActualAmount());
      oForm.setTotalamount(actualAmount);
     
      String forecast = currencyFormat.format(oVO.getForecastedAmount());
      oForm.setForecastedamount(forecast);
     
      if (oVO.getCreateddate() != null) {
        Timestamp date = (Timestamp)oVO.getCreateddate();
       
        String strMonth = String.valueOf(date.getMonth() + 1);
        String strDay = String.valueOf(date.getDate());
        String strYear = String.valueOf(date.getYear() + 1900);
        String strHours = String.valueOf(date.getHours());
        String strMins = String.valueOf(date.getMinutes());
        int hhmm[] = new int[2];
        hhmm[0] = Integer.parseInt(strHours.trim());
        hhmm[1] = Integer.parseInt(strMins.trim());
        String strTime = CVUtility.convertTime24HrsFormatToStr(hhmm);
        oForm.setCreateddate(strMonth + "/" + strDay + "/" + strYear + " - " + strTime + " ");
      }
     
      if (oVO.getModifieddate() != null) {
        Timestamp date = (Timestamp)oVO.getModifieddate();
       
        String strMonth = String.valueOf(date.getMonth() + 1);
        String strDay = String.valueOf(date.getDate());
        String strYear = String.valueOf(date.getYear() + 1900);
        String strHours = String.valueOf(date.getHours());
        String strMins = String.valueOf(date.getMinutes());
       
        int hhmm[] = new int[2];
        hhmm[0] = Integer.parseInt(strHours.trim());
        hhmm[1] = Integer.parseInt(strMins.trim());
        String strTime = CVUtility.convertTime24HrsFormatToStr(hhmm);
View Full Code Here


                              new Integer(i),
                              new Long(i),
                              new Short((short)i),
                              sampleString(i),
                              new Time(currentTime),
                              new Timestamp(currentTime)
                            };
            batch[i] = Arrays.asList(data);
        }
        return batch;
    }
View Full Code Here

                              (mod == 8) ? null : new Integer(i),
                              (mod == 9) ? null : new Long(i),
                              (mod == 10) ? null : new Short((short)i),
                              (mod == 11) ? null : sampleString(i),
                              (mod == 12) ? null : new Time(currentTime),
                              (mod == 13) ? null : new Timestamp(currentTime)
                            };
            batch[i] = Arrays.asList(data);
        }
        return batch;
    }
View Full Code Here

        promotionDetailListForm.setPstatus(promotionVO.getStatus());
        promotionDetailListForm.setNotes(promotionVO.getNotes());

        if (promotionVO.getStartdate() != null)
        {
          Timestamp date = (Timestamp)promotionVO.getStartdate();
          String strMonth = "" + (date.getMonth() + 1);
          String strDay = "" + date.getDate();
          String strYear = "" + (date.getYear() + 1900);
          promotionDetailListForm.setStartmonth(strMonth);
          promotionDetailListForm.setStartday(strDay);
          promotionDetailListForm.setStartyear(strYear);
        }

        if (promotionVO.getEnddate() != null)
        {
          Timestamp date = (Timestamp)promotionVO.getEnddate();
          String strMonth = "" + (date.getMonth() + 1);
          String strDay = "" + date.getDate();
          String strYear = "" + (date.getYear() + 1900);
          promotionDetailListForm.setEndmonth(strMonth);
          promotionDetailListForm.setEndday(strDay);
          promotionDetailListForm.setEndyear(strYear);
        }
View Full Code Here

      promotionDetailListForm.setPstatus(promotionVO.getStatus());
      promotionDetailListForm.setNotes(promotionVO.getNotes());

      if (promotionVO.getStartdate() != null)
      {
        Timestamp date = (Timestamp)promotionVO.getStartdate();
        String strMonth = "" + (date.getMonth() + 1);
        String strDay = "" + date.getDate();
        String strYear = "" + (date.getYear() + 1900);
        promotionDetailListForm.setStartmonth(strMonth);
        promotionDetailListForm.setStartday(strDay);
        promotionDetailListForm.setStartyear(strYear);
      }

      if (promotionVO.getEnddate() != null)
      {
        Timestamp date = (Timestamp)promotionVO.getEnddate();
        String strMonth = "" + (date.getMonth() + 1);
        String strDay = "" + date.getDate();
        String strYear = "" + (date.getYear() + 1900);
        promotionDetailListForm.setEndmonth(strMonth);
        promotionDetailListForm.setEndday(strDay);
        promotionDetailListForm.setEndyear(strYear);
      }
View Full Code Here

        String startday = (String)dynaForm.get("startday");
        String startyear = (String)dynaForm.get("startyear");
        String startTime = (String)dynaForm.get("starttime");

        try {
          Timestamp start = DateUtility.createTimestamp(startyear, startmonth, startday, startTime);
          mapEvent.put("StartDate", start);
        } catch (Exception e) {
          logger.error("[execute] SaveNewEventHandler saveEvent thrown.", e);
        }// end of catch block
      }// end of if ((dynaForm.get("startmonth") != null)...

      if ((dynaForm.get("endmonth") != null) && (dynaForm.get("endday") != null)
          && (dynaForm.get("endyear") != null)) {
        String endmonth = (String)dynaForm.get("endmonth");
        String endday = (String)dynaForm.get("endday");
        String endyear = (String)dynaForm.get("endyear");
        String endTime = (String)dynaForm.get("endtime");

        try {
          Timestamp end = DateUtility.createTimestamp(endyear, endmonth, endday, endTime);
          mapEvent.put("EndDate", end);
        } catch (Exception e) {
          logger.error("[execute] SaveNewEventHandler saveEvent thrown.", e);
        }// end of catch block
      }// end of if ((dynaForm.get("endmonth") != null) ....
View Full Code Here

      //���뵽ָ����site
      ubean.setSite(site);
      ubean.setName(user.getLoginName());
      ubean.setNickname(user.getDisplayName());
      ubean.setPassword(user.getPassword());
      ubean.setRegTime(new Timestamp(user.getRegTime().getTime()));
      ubean.setResume(user.getResume());
      ubean.setEmail(user.getEmail());
      ubean.setHomePage(StringUtils.abbreviate(user.getHomePage(),50));
      ubean.setLastAddr(user.getLastAddr());
      if(user.getLastTime()!=null)
        ubean.setLastTime(new Timestamp(user.getLastTime().getTime()));
      new_ssn.save(ubean);
      //�����¾��û��ı�Ŷ�Ӧ��ϵ
      userids.put(new Integer(user.getId()), ubean);
      System.out.println("User: " + user.getId() + " -> " + ubean.getId());
    }
View Full Code Here

                            Thread.sleep(60 * 1000);
                        } catch (InterruptedException e) {
                            // ignore
                        }
                    }
                    String time = new Timestamp(System.currentTimeMillis()).toString();
                    System.out.println(time + " Killing the process after " + minutes + " minute(s)");
                    try {
                        Map<Thread, StackTraceElement[]> map = Thread.getAllStackTraces();
                        for (Map.Entry<Thread, StackTraceElement[]> en : map.entrySet()) {
                            System.out.println(en.getKey());
View Full Code Here

            }
        }
    }

    private void loadCustomerSub(int dId, int wId) throws SQLException {
        Timestamp timestamp = new Timestamp(System.currentTimeMillis());
        PreparedStatement prepCustomer = database.prepare(
                "INSERT INTO CUSTOMER(C_ID, C_D_ID, C_W_ID, " +
                "C_FIRST, C_MIDDLE, C_LAST, " +
                "C_STREET_1, C_STREET_2, C_CITY, C_STATE, C_ZIP, " +
                "C_PHONE, C_SINCE, C_CREDIT, " +
View Full Code Here

            }
        }
    }

    private void loadOrderSub(int dId, int wId) throws SQLException {
        Timestamp timestamp = new Timestamp(System.currentTimeMillis());
        int[] orderid = random.getPermutation(ordersPerDistrict);
        PreparedStatement prepOrder = database.prepare(
                "INSERT INTO ORDERS(O_ID, O_C_ID, O_D_ID, O_W_ID, " +
                "O_ENTRY_D, O_CARRIER_ID, O_OL_CNT, O_ALL_LOCAL) " +
                "VALUES(?, ?, ?, ?, ?, ?, ?, 1)");
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.