教室管理信息系统的设计与实现课设内容内容摘要:

odel(Vector rowData,Vector columnNames) { =rowData。 =columnNames。 } public static Vector select(String value) { rowData=new Vector()。 columnNames=new Vector()。 Connection connection=null。 河北联合大学课程设计 第 23 页 共 53 页 PreparedStatement ps=null。 ResultSet rs=null。 String sql = null。 if(value==教师信息 ) { (教师编号 )。 (教师姓名 )。 (教授课程 )。 (教师职称 )。 sql=select * from TeacherInfo。 }else if(value==教室信息 ) { (教室编号 )。 (教室设备 )。 (教室容纳人数 )。 (教室管理员编号 )。 sql=select * from ClassInfo。 }else if(value==教室使用情况 ) { (教室编号 )。 (上课开始时间 )。 (结束时间 )。 (教师编号 )。 sql=select 教室编号 , convert(varchar(20),上课开始时间 ,111),convert(varchar(20),上课开始时间 ,108),convert(varchar(20),结束时间 ,111) ,convert(varchar(20),结束时间 ,108), 教师编号 from ClassRoomInfo。 } else if(value==教室具体使用情况 ) { (教室编号 )。 (教师编号 )。 (教师姓名 )。 (教授课程 )。 (上课开始时间 )。 (结束时间 )。 (教师职称 )。 河北联合大学课程设计 第 24 页 共 53 页 (教室设备 )。 (教室容纳人数 )。 (教室管理员编号 )。 sql=select , , ,TeacherInfo.教授课程 , convert(varchar(20), ,111),convert(varchar(20),ClassRoomInfo.上课开始时间 ,108),convert(varchar(20), ,111) ,convert(varchar(20), ,108) , , ,数 , from ClassRoomInfo,TeacherInfo,ClassInfo where = and =。 } try { //加载驱动 ()。 //得到连接 connection=(jdbc:odbc:classManager, sa, songchao)。 //创建访问数据库接口 ps=(sql)。 rs=()。 if(value==教师信息 ) { while(()) { Vector tem=new Vector()。 ((1))。 ((2))。 ((3))。 ((4))。 (tem)。 } }else if(value==教室信息 ) { while(()) { Vector tem=new Vector()。 ((1))。 ((2))。 河北联合大学课程设计 第 25 页 共 53 页 ((3))。 ((4))。 (tem)。 } }else if(value==教室使用情况 ) { while(()) { Vector tem=new Vector()。 ((1))。 ((2)+/+(3))。 ((4)+/+(5))。 ((6))。 (tem)。 } }else if(value==教室具体使用情况 ){ while(()) { Vector tem=new Vector()。 ((1))。 ((2))。 ((3))。 ((4))。 ((5)+/+(6))。 ((7)+/+(8))。 ((9))。 ((10))。 ((11))。 ((12))。 (tem)。 } } } catch (Exception e) { ()。 }finally{ try { 河北联合大学课程设计 第 26 页 共 53 页 ()。 ()。 ()。 } catch (SQLException e) { ()。 } } return rowData。 } @Override public String getColumnName(int arg0) { return (String) (arg0)。 } @Override public int getColumnCount() { return ()。 } @Override public int getRowCount() { return ()。 } @Override public Object getValueAt(int rowIndex, int columnIndex) { return ((Vector)(rowIndex)).get(columnIndex)。 } } package。 import。 import。 import。 import。 import。 import。 import。 import。 河北联合大学课程设计 第 27 页 共 53 页 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 import。 public class Update extends JDialog{ private JLabel warn=new JLabel()。 //提示文本 private JButton sure=new JButton(确定 )。 private JButton cancle=new JButton(取消 )。 private String sql。 final JTextField t51=new JTextField(15)。 final JTextField t52=new JTextField(15)。 final JTextField t53=new JTextField(15)。 final JTextField t54=new JTextField(15)。 public Update(Frame owner, String title, boolean modal,String name,final Vector v) { super(owner, title, modal)。 (0, 0, 300, 50)。 ((0).toString())。 (false)。 ((1).toString())。 ((2).toString())。 ((3).toString())。 if(name==教师信息 ) { JLabel t1=new JLabel(教师编号 :)。 JLabel t2=new JLabel(教师姓名 :)。 JLabel t3=new JLabel(教授课程 :)。 JLabel t4=new JLabel(教师职称 :)。 (new ActionListener() 河北联合大学课程设计 第 28 页 共 53 页 { @Override public void actionPerformed(ActionEvent e) { String tNum=()。 String tName=().trim()。 String tCourse=().trim()。 String tTitle=().trim()。 if(()=0||()=0||()=0||()=0) { (信息不全 )。 return。 } sql=UPDATE TeacherInfo SET 教师姓名 =39。 +tName+39。 , 教 授 课 程 =39。 +tCourse+39。 ,教师职称 =39。 +tTitle+39。 WHERE 教师编号 = 39。 +tNum+39。 update2Table(sql)。 ()。 } })。 (new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ()。 } })。 (t1)。 (t51)。 (t2)。 (t52)。 (t3)。 (t53)。 (t4)。 (t54)。 (sure)。 (cancle)。 (warn)。 河北联合大学课程设计 第 29 页 共 53 页 (new FlowLayout())。 (250,300)。 (550, 100)。 (false)。 (true)。 (DISPOSE_ON_CLOSE)。 }else if(name==教室信息 ) { JLabel t1=new JLabel( 教 室 编 号 :)。 JLabel t2=new JLabel( 教 室 设 备 :)。 JLabel t3=new JLabel(教 室 容 纳 人 数 :)。 JLabel t4=new JLabel(教室管理员编号 :)。 (new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String tNum=()。 String tName=().trim()。 String tCourse=().trim()。 String tTitle=().trim()。 if(()=0||()=0||()=0||()=0) { (信息不全 )。 return。 } sql=UPDATE ClassInfo SET 教室 设 备 =39。 +tName+39。 , 教室 容 纳人 数=39。 +tCourse+39。 ,教室管理员编号 =39。 +tTitle+39。 WHERE 教室编号 = 39。 +tNum+39。 update2Table(sql)。 ()。 } })。 (new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ()。 河北联合大学课程设计 第 30 页 共 53 页 } })。 (t1)。 (t51)。 (t2)。 (t52)。 (t3)。 (t53)。 (t4)。 (t54)。 (sure)。 (cancle)。 (warn)。 (new FlowLayout())。 (220,300)。 (550, 100)。 (false)。 (true。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。