?? finalresult.java~30~
字號:
package com.jbaptech.accp.netbar.client;
import java.sql.*;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: 北京阿博泰克北大青鳥信息技術有限公司</p>
*
* @author Michael Luo
* @version 1.0
*/
public class FinalResult {
String cardId ;
String computerId ;
String beginTime ;
String endTime ;
int fee ;
int balance;
public FinalResult() {
}
public void select(String ComputerId){
Connection con = ConnectionManager.getConnection();
CheckOutResultPanel CheckOutResult = new CheckOutResultPanel();
try{
String sql1 = "select * from Record where ComputerId = '"+ComputerId+"'";
Statement s = con.createStatement();
ResultSet rs = s.executeQuery(sql1);
while(rs.next()){
cardId = rs.getString("cardId");
computerId = rs.getString(3);
beginTime = rs.getDate(4).toString();
endTime = rs.getDate(5).toString();
fee = rs.getInt(6);
}
System.out.println(computerId);
System.out.println(cardId);
CheckOutResult.computerIdLabel.setText(computerId);
CheckOutResult.cardIdLabel.setText(cardId);
CheckOutResult.beginTimeLabel.setText(beginTime);
CheckOutResult.endTimeLabel.setText(endTime);
CheckOutResult.consumerFeeLabel.setText(Integer.toString(fee));
String sql2 = "select * from Card where Id ='"+cardId+"'";
Statement s2 = con.createStatement();
ResultSet rs2 = s2.executeQuery(sql2);
while(rs2.next()){
balance = rs2.getInt("balance");
}
CheckOutResult.balanceLabel.setText(Integer.toString(balance-fee));
con.close();
}catch (SQLException ce){
ce.printStackTrace();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -