虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

您现在的位置是:虫虫下载站 > 资源下载 > Java书籍 > pstmt = conn.prepareStatement("select ordernumber,datetime,price,dayofmoney from zujie where ordernu

pstmt = conn.prepareStatement("select ordernumber,datetime,price,dayofmoney from zujie where ordernu

资 源 简 介

pstmt = conn.prepareStatement("select ordernumber,datetime,price,dayofmoney from zujie where ordernumber= "+ cdName + " ") rs=pstmt.executeQuery() if(rs!=null && rs.next()){ String datetime = rs.getString(2) java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat ("yyyy-MM-dd") Date date = new Date() String date1=formatter.format(date) ParsePosition pos = new ParsePosition(0) ParsePosition pos1 = new ParsePosition(0) Date dt1=formatter.parse(datetime,pos) Date dt2=formatter.parse(date1,pos1) Long l = (dt2.getTime()-dt1.getTime())/(3600*24*1000)+1 double price = rs.getDouble(3) double dayofmoney=rs.getDouble(4) double dayofmoneybuy=dayofmoney*l double otherMoney = price-dayofmoneybuy request.setAttribute("price", price) request.setAttribute("l", l) request.setAttribute("dayofmoney", dayofmoneybuy) request.setAttribute("otherMoney", otherMoney)

相 关 资 源

您 可 能 感 兴 趣 的