资源简介

数据库课程设计 用java语言实现 Oracle数据库

资源截图

代码片段和文件信息

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:stu““system““system“);
        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();
}

}

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

     文件       3126  2009-07-01 21:32  代码\Count1.java

     文件       4090  2009-07-01 21:32  代码\Count2.java

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

     文件       2346  2009-07-01 21:32  代码\Count31.java

     文件       2364  2009-07-01 21:32  代码\Count32.java

     文件       2328  2009-07-01 21:32  代码\Count33.java

     文件       2464  2009-07-01 21:32  代码\InsertRecord.java

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

     文件       2824  2009-07-01 21:32  代码\InsertScore11.java

     文件       2851  2009-07-02 12:40  代码\InsertScore12.java

     文件       2823  2009-07-02 12:44  代码\InsertScore13.java

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

     文件       2518  2009-07-01 21:32  代码\InsertScore21.java

     文件       2511  2009-07-01 21:32  代码\InsertScore22.java

     文件       2492  2009-07-01 21:32  代码\InsertScore23.java

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

     文件       3274  2009-07-01 21:32  代码\ModifyRecord.java

     文件       2015  2009-07-01 21:32  代码\ShowRecord.java

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

     文件       1515  2009-07-01 21:32  代码\ShowScore11.java

     文件       1519  2009-07-01 21:32  代码\ShowScore12.java

     文件       1511  2009-07-01 21:32  代码\ShowScore13.java

     文件       1340  2009-07-01 21:32  代码\ShowScore2.java

     文件       2528  2009-07-01 21:32  代码\ShowScore21.java

     文件       2410  2009-07-01 21:32  代码\ShowScore22.java

     文件       2515  2009-07-01 21:32  代码\ShowScore23.java

     文件       1366  2009-07-01 21:32  代码\ShowScore3.java

     文件       2226  2009-07-01 21:32  代码\ShowScore31.java

     文件       2241  2009-07-01 21:32  代码\ShowScore32.java

     文件       2212  2009-07-01 21:32  代码\ShowScore33.java

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

评论

共有 条评论