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)
標簽:
prepareStatement
ordernumber
dayofmoney
datetime
上傳時間:
2013-12-14
上傳用戶:zsjinju
www工具包. 這是W3C官方支持的www支撐庫. 其中提供通用目的的客戶端的WebAPI: complete HTTP/1.1 (with caching, pipelining, PUT, PosT, Digest Authentication, deflate, etc), MySQL logging, FTP, HTML/4, XML (expat), RDF (SiRPAC), WebDAV, and much more
標簽:
pipelining
www
complete
caching
上傳時間:
2017-02-24
上傳用戶:qq21508895