overuse.java~9~
来自「一个java+sql2000开发的网吧管理系统」· JAVA~9~ 代码 · 共 55 行
JAVA~9~
55 行
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(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 + =
减小字号Ctrl + -
显示快捷键?