十一、附录
Java界面部分代码
连接数据库:
import java.sql.*;
public class Link_SQL{
Connection conn;
Statement stm;
PreparedStatement pstm;
ResultSet rs;
public Link_SQL()throws Exception{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:lzx","","");
}catch(ClassNotFoundException e){
//TODO Auto‐generated catch block
e.printStackTrace();
}
}
//功能
}
管理员用户界面:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class G_mainFrame extends JFrame implements ActionListener{ JButton btnaddG=new JButton("添加管理员");
JButton updateG=new JButton("修改管理员信息");
JButton select_M_and_T=new JButton("查看机房收费和时长");
JButton how_maney=new JButton("查看各管理员收费");
JButton addJF=new JButton("添加机房信息");
JButton selectJF=new JButton("查看机房信息");
JButton updateJF=new JButton("更改机房信息");
JButton addJQ=new JButton("添加机器信息");
JButton selectJQ=new JButton("查看机器信息");
JButton updateJQ=new JButton("更改机器信息");