• 大小: 34KB
    文件类型: .rar
    金币: 2
    下载: 0 次
    发布日期: 2024-01-26
  • 语言: Java
  • 标签: 研究生  管理  

资源简介

本资料用java编写,同时利用sql server整理数据库,实现对研究生的管理

资源截图

代码片段和文件信息

import javax.swing.*;

import java.awt.*;
import java.awt.event.*;
import java.sql.*; 

public class Count1 extends JDialog implements ActionListener{

    object name[]={“考号““姓名““总成绩““平均成绩“};
    String [][] a;
    JTable table;
    JButton show; 
    Connection con;
    Statement sql; 
    ResultSet rs1rs2rs3;
Count1(String s){
settitle(s);
show=new JButton(“显示统计信息“);

    show.addActionListener(this);
    add(showBorderLayout.NORTH);

setBounds(120160600200);
}
    public void actionPerformed(ActionEvent e){
try{
        con=DriverManager.getConnection(“jdbc:odbc:hello““system““q1234“);
        con.setAutoCommit(false);
            sql=con.createStatement
            (ResultSet.TYPE_SCROLL_SENSITIVEResultSet.CONCUR_READ_ONLY);
            rs1=sql.executeQuery(“select 考号姓名(外语成绩+政治成绩+专业基础成绩+专业成绩)总成绩 from 计算机初试“); 
            rs1.last();
            int lastNumber1=rs1.getRow();
            rs1.beforeFirst();  
            rs2=sql.executeQuery(“select 考号姓名(外语成绩+政治成绩+专业基础成绩+专业成绩)总成绩  from 生物工程初试“); 
            rs2.last();
            int lastNumber2=rs2.getRow();
            rs2.beforeFirst();
            rs3=sql.executeQuery(“select 考号姓名(外语成绩+政治成绩+专业基础成绩+专业成绩)总成绩  from 经管初试“); 
            rs3.last();
            int lastNumber3=rs3.getRow();
            rs3.beforeFirst();

            int lastNumber=lastNumber1+lastNumber2+lastNumber3;
            a=new String[lastNumber][4];
            int k=0;
            rs1=sql.executeQuery(“select 考号姓名(外语成绩+政治成绩+专业基础成绩+专业成绩)总成绩  from 计算机初试“); 
            while(rs1.next()){
             a[k][0]=rs1.getString(1);
             a[k][1]=rs1.getString(2);
             a[k][2]=rs1.getString(3);
             double h=rs1.getDouble(3)/4;
             a[k][3]=String.valueOf(h);
             k++;
            }
            rs2=sql.executeQuery(“select 考号姓名(外语成绩+政治成绩+专业基础成绩+专业成绩)总成绩  from 生物工程初试“); 
            while(rs2.next()){
             a[k][0]=rs2.getString(1);
             a[k][1]=rs2.getString(2);
             a[k][2]=rs2.getString(3);
             double h=rs2.getDouble(3)/4;
             a[k][3]=String.valueOf(h);
             k++;
            }
            rs3=sql.executeQuery(“select 考号姓名(外语成绩+政治成绩+专业基础成绩+专业成绩)总成绩 from 经管初试“);
            while(rs3.next()){
             a[k][0]=rs3.getString(1);
             a[k][1]=rs3.getString(2);
             a[k][2]=rs3.getString(3);
             double h=rs3.getDouble(3)/4;
             a[k][3]=String.valueOf(h);
             k++;
            }
            con.commit();
            con.close();
}
catch(SQLException ee){ 
           System.out.println(ee);
       } 
   table=new JTable(aname);
       getContentPane().removeAll();
       add(new JScrollPane(table)BorderLayout.CENTER);
       
   validate();
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        281  2009-06-23 10:37  yanjiusheng\专业字典.sql

     文件        849  2009-06-30 17:03  yanjiusheng\初试成绩.sql

     文件        253  2009-07-01 08:11  yanjiusheng\复试成绩.sql

     文件       1854  2009-07-02 12:41  yanjiusheng\存储过程.sql

     文件        255  2009-06-26 19:37  yanjiusheng\录取名单.sql

     文件        297  2009-07-01 08:35  yanjiusheng\总录取名单.sql

     文件       7802  2009-06-30 17:09  yanjiusheng\插成绩.sql

     文件       7904  2009-06-23 10:47  yanjiusheng\考生档案.sql

     文件        239  2009-06-24 22:47  yanjiusheng\视图.sql

     文件       3127  2010-07-05 10:11  yanjiusheng\代码\Count1.java

     文件       4091  2010-07-05 10:11  yanjiusheng\代码\Count2.java

     文件       1185  2009-07-01 21:32  yanjiusheng\代码\Count3.java

     文件       2347  2010-07-05 10:11  yanjiusheng\代码\Count31.java

     文件       2365  2010-07-05 10:11  yanjiusheng\代码\Count32.java

     文件       2329  2010-07-05 10:12  yanjiusheng\代码\Count33.java

     文件       2465  2010-07-05 10:12  yanjiusheng\代码\InsertRecord.java

     文件       1423  2009-07-01 21:32  yanjiusheng\代码\InsertScore1.java

     文件       2826  2010-07-05 19:39  yanjiusheng\代码\InsertScore11.java

     文件       2853  2010-07-05 19:40  yanjiusheng\代码\InsertScore12.java

     文件       2825  2010-07-05 19:41  yanjiusheng\代码\InsertScore13.java

     文件       1420  2009-07-01 21:32  yanjiusheng\代码\InsertScore2.java

     文件       2520  2010-07-05 19:41  yanjiusheng\代码\InsertScore21.java

     文件       2513  2010-07-05 19:42  yanjiusheng\代码\InsertScore22.java

     文件       2494  2010-07-05 19:42  yanjiusheng\代码\InsertScore23.java

     文件       4851  2009-07-01 21:32  yanjiusheng\代码\Manage.java

     文件       3275  2010-07-05 10:14  yanjiusheng\代码\ModifyRecord.java

     文件       2016  2010-07-05 10:14  yanjiusheng\代码\ShowRecord.java

     文件       1342  2009-07-01 21:32  yanjiusheng\代码\ShowScore1.java

     文件       1516  2010-07-05 10:15  yanjiusheng\代码\ShowScore11.java

     文件       1520  2010-07-05 10:15  yanjiusheng\代码\ShowScore12.java

............此处省略15个文件信息

评论

共有 条评论