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

📄 overuse.java~10~

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

  public String getBeginTime(String ComputerId){
   String BeginTime="";
    try{
      Connection con = ConnectionManager.getConnection();
      String sql = "select BeginTime from Record where ComputerId ='"+ComputerId+"'";
      Statement s =con.createStatement();
      ResultSet rs = s.executeQuery(sql);
      BeginTime = rs.getDate(1).toString();

    }catch (SQLException ce){
      System.out.println("bbb"+ce);
    }
    return BeginTime;
  }

  public void update(String ComputerId,String EndTime,int ree){


    Connection con =ConnectionManager.getConnection();

    try{
      String sql
          = "update Record set EndTime = ?,Fee = ? where ComputerId ='"+ComputerId+"'";
      PreparedStatement ps = con.prepareStatement(sql);
      ps.setString(1,EndTime);
      ps.setInt(2,ree);
      ps.executeUpdate();

      con.close();
    }catch (SQLException ce){
      ce.printStackTrace();
      System.out.println("aaa"+ce);
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -