当前位置:文档之家› 简单的JAVA员工信息管理系统源码

简单的JAVA员工信息管理系统源码

(jl3);
(jtf3);
(jp3);
JPanel jp4 = new JPanel();
JLabel jl4 = new JLabel("EngName*");
(jl4);
(jtf4);
(jp4);
JPanel jp5 = new JPanel();
JLabel jl5 = new JLabel("UNIT ");
+ () + () + () + ")";
int i = ();
if (() != null) && () != null)
&& () != null) && () != null)) {
(sql);
("添加记录成功" + i + "条");
} else {
("带*号项为添加记录时不能为空");
}
} catch (SQLException e1) {
+ ().toLowerCase().trim() + "and TEAM="
+ ().toLowerCase().trim() + "and Phone="
+ ().toLowerCase().trim() + "and region="
+ ().toLowerCase().trim() + "and busStation="
StringBuffer sb = new StringBuffer();
JTextField jtf2 = new JTextField("张飞",10);
JTextField jtf3 = new JTextField(10);
JTextField jtf4 = new JTextField(10);
SQL工具类JdbcUtil:用于实现数据库连接和数据库关闭。上面程序用到了这个类
//close resultSet,statement and connection
public static void close(ResultSet rs,Statement stmt,Connection con){
(" " + (i) + " =");
(i));
}
("\n");
());
}
} catch (SQLException e11) {
();
}
}
public void addEmp() {
try {
stmt = ();
sql = "update Mstar values(" + () + ()
+ () + () + ()
searchEmp();
sql = "update Mstar set chineseName="
+ ().toLowerCase().trim() + "and id="
+ ().toLowerCase().trim() + "and engName="
+ ().toLowerCase().trim() + "and UNIT="
+ ().toLowerCase().trim() + "or busStation="
+ ().toLowerCase().trim();
(sql);
int i = ();
("撤除操作成功" + i + "条");
} catch (SQLException e) {
();
}
}
public void alterEmp() {
简单的JAVA员工信息管理系统源码
据库连接3.查询4.增、5删6改(操作数据库)
import .*;
public class EmpManageSys implements ActionListener {
Connection con;
Statement stmt;
String sql;
ResultSet rs;
(jl7);
(jtf7);
(jp7);
JPanel jp8 = new JPanel();
JLabel jl8 = new JLabel("区域");
(jl8);
(jtf8);
(jp8);
JPanel jp9 = new JPanel();
JLabel jl9 = new JLabel("公交站");
(jl9);
(jtf9);
(jp9);
(jp00);
JPanel jp01 = new JPanel();
("--用户使用手册-- \n1、查询:选择一个字段,如EngName在文本框中输入相应内容,点击查询\n2、增加:在各个文本框中输入相应内容后,点击增加。\n3、修改:先查询到你要的记录,在更改相应内容,点击修改。\n4、撤除:类似于修改操作");
(jta10);
(jp01);
(700, 500);
;
(true);
}
public static void main(String[] args) {
new EmpManageSys();
}
}
//---------------------------------------------------------------------
try{
if(rs!=null) ();
}catch(Exception ex){
();
}
try{
if(stmt!=null) ();
}catch(Exception ex){
();
}
try{
if(con!=null) ();
}catch(Exception ex){
();
}
}
}
(new GridLayout(2, 1));
// (new GridLayout(10,2));
JPanel jp00 = new JPanel(new GridLayout(5, 4));
JPanel jp1 = new JPanel();
JButton jb11 = new JButton("查询");
(this);
JButton jb12 = new JButton("增加");
(this);
(jb11);
(jb12);
(jp1);
JPanel jp11 = new JPanel();
JButton jb111 = new JButton("修改");
(this);
JButton jb112 = new JButton("撤除");
JTextField jtf7 = new JTextField(10);
JTextField jtf5 = new JTextField(10);
JTextField jtf6 = new JTextField(10);
JTextField jtf8 = new JTextField(10);
JTextField jtf9 = new JTextField(10);
+ ().toLowerCase().trim();
int i = 0;
try {
(sql);
i = ();
} catch (SQLException e) {
();
}
("修改操作成功" + i + "条");
}
public v = new JFrame("员工信息管理系统");
(this);
(jb111);
(jb112);
(jp11);
JPanel jp2 = new JPanel();
JLabel jl2 = new JLabel("中文名* ");
(jl2);
(jtf2);
(jp2);
JPanel jp3 = new JPanel();
JLabel jl3 = new JLabel("工号");
();
}
}
public void deleteEmp() {
searchEmp();
try {
stmt = ();
sql = "delete from Mstar where chineseName="
+ ().toLowerCase().trim() + "or id="
+ ().toLowerCase().trim() + "or engName="
+ ().toLowerCase().trim() + "or UNIT="
+ ().toLowerCase().trim() + "or TEAM="
+ ().toLowerCase().trim() + "or Phone="
相关主题