⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 finalresult.java~31~

📁 一个java+sql2000开发的网吧管理系统
💻 JAVA~31~
字号:
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);
      }

      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 + -