⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 person_info.java~75~

📁 一款高校科研管理系统
💻 JAVA~75~
字号:
package scince;

import java.awt.*;
import java.sql.*;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import com.borland.dx.dataset.TableDataSet;
import com.borland.dbswing.JdbTable;
import java.io.*;
public class person_Info extends JFrame {
    public person_Info() {
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        getContentPane().setLayout(gridBagLayout1);
        jLabel1.setText("编码");
        getContentPane().setSize(305, 580);
        jButton1.addActionListener(new person_Info_jButton1_actionAdapter(this));
        jButton1.setText("查看");
        jLabel12.setText("津贴工资");
        jLabel11.setText("岗位工资");
        jLabel10.setText("基本工资");
        jLabel9.setText("职称");
        jLabel8.setText("参加工作时间");
        jLabel7.setText("所在部门");
        jLabel6.setText("文化程度");
        jLabel5.setText("民族");
        jLabel4.setText("出生年月日");
        jLabel3.setText("性别");
        this.getContentPane().add(jButton1,
                                  new GridBagConstraints(0, 10, 4, 1, 0.0, 0.0
                , GridBagConstraints.CENTER, GridBagConstraints.NONE,
                new Insets(10, 62, 0, 21), 34, 14));
        this.getContentPane().add(jTextField12,
                                  new GridBagConstraints(5, 9, 1, 1, 1.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(16, 0, 0, 411), 100, 5));
        this.getContentPane().add(jTextField11,
                                  new GridBagConstraints(5, 7, 1, 2, 1.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(11, 0, 0, 416), 88, 14));
        this.getContentPane().add(jTextField10,
                                  new GridBagConstraints(5, 5, 1, 2, 1.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(21, 0, 0, 418), 84, 14));
        this.getContentPane().add(jTextField9,
                                  new GridBagConstraints(5, 3, 1, 2, 1.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(10, 12, 0, 423), 72, 11));
        this.getContentPane().add(jTextField8,
                                  new GridBagConstraints(5, 1, 1, 1, 1.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(24, 11, 0, 415), 81, 17));
        this.getContentPane().add(jTextField7,
                                  new GridBagConstraints(5, 0, 1, 1, 1.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(9, 9, 0, 413), 85, 8));
        this.getContentPane().add(jTextField6,
                                  new GridBagConstraints(2, 9, 2, 1, 1.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(0, 6, 11, 0), 72, 12));
        this.getContentPane().add(jTextField5,
                                  new GridBagConstraints(3, 7, 1, 1, 1.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(0, 0, 9, 0), 62, 11));
        this.getContentPane().add(jTextField4,
                                  new GridBagConstraints(2, 5, 2, 1, 1.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(0, 7, 13, 0), 68, 11));
        this.getContentPane().add(jTextField3,
                                  new GridBagConstraints(2, 2, 2, 2, 1.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(0, 0, 0, 0), 72, 5));
        this.getContentPane().add(jTextField2,
                                  new GridBagConstraints(2, 1, 2, 1, 1.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(23, 0, 14, 0), 73, 4));
        this.getContentPane().add(jTextField1,
                                  new GridBagConstraints(3, 0, 1, 1, 1.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(18, 0, 0, 7), 61, 3));
        this.getContentPane().add(jLabel12,
                                  new GridBagConstraints(4, 9, 1, 1, 0.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.NONE,
                new Insets(0, 118, 0, 13), 17, 16));
        this.getContentPane().add(jLabel11,
                                  new GridBagConstraints(4, 7, 1, 1, 0.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.NONE,
                new Insets(9, 121, 0, 18), 9, 14));
        this.getContentPane().add(jLabel10,
                                  new GridBagConstraints(4, 5, 1, 2, 0.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.NONE,
                new Insets(13, 120, 0, 9), 19, 30));
        this.getContentPane().add(jLabel9,
                                  new GridBagConstraints(4, 3, 1, 2, 0.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.NONE,
                new Insets(9, 122, 0, 12), 38, 16));
        this.getContentPane().add(jLabel8,
                                  new GridBagConstraints(4, 1, 1, 2, 0.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.NONE,
                new Insets(26, 124, 0, 0), 1, 28));
        this.getContentPane().add(jLabel7,
                                  new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.NONE,
                new Insets(9, 124, 0, 0), 24, 20));
        this.getContentPane().add(jLabel6,
                                  new GridBagConstraints(0, 8, 2, 2, 0.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.NONE,
                new Insets(0, 22, 16, 10), 5, 15));
        this.getContentPane().add(jLabel5,
                                  new GridBagConstraints(0, 6, 1, 2, 0.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.NONE,
                new Insets(0, 22, 9, 0), 21, 26));
        this.getContentPane().add(jLabel4,
                                  new GridBagConstraints(0, 4, 2, 2, 0.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.NONE,
                new Insets(16, 22, 0, 0), 5, 34));
        this.getContentPane().add(jLabel3,
                                  new GridBagConstraints(0, 2, 2, 2, 0.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.NONE,
                new Insets(0, 30, 0, 0), 27, 14));
        this.getContentPane().add(jLabel2,
                                  new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.NONE,
                new Insets(13, 30, 16, 0), 31, 17));
        this.getContentPane().add(jLabel1,
                                  new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0
                , GridBagConstraints.WEST, GridBagConstraints.NONE,
                new Insets(15, 30, 0, 0), 45, 12));
        jLabel2.setText("姓名");
        this.getContentPane().add(jScrollPane1,
                                  new GridBagConstraints(1, 11, 5, 1, 1.0, 1.0
                , GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                new Insets(34, 0, 57, 315), 506, 270));

    }

    JLabel jLabel1 = new JLabel();
    JLabel jLabel2 = new JLabel();
    JLabel jLabel3 = new JLabel();
    JLabel jLabel4 = new JLabel();
    JLabel jLabel5 = new JLabel();
    JLabel jLabel6 = new JLabel();
    JLabel jLabel7 = new JLabel();
    JLabel jLabel8 = new JLabel();
    JLabel jLabel9 = new JLabel();
    JLabel jLabel10 = new JLabel();
    JLabel jLabel11 = new JLabel();
    JLabel jLabel12 = new JLabel();
    JTextField jTextField1 = new JTextField();
    JTextField jTextField2 = new JTextField();
    JTextField jTextField3 = new JTextField();
    JTextField jTextField4 = new JTextField();
    JTextField jTextField5 = new JTextField();
    JTextField jTextField6 = new JTextField();
    JTextField jTextField7 = new JTextField();
    JTextField jTextField8 = new JTextField();
    JTextField jTextField9 = new JTextField();
    JTextField jTextField10 = new JTextField();
    JTextField jTextField11 = new JTextField();
    JTextField jTextField12 = new JTextField();
    JButton jButton1 = new JButton();
    private String sqlString;
    private Connection con;
    private Statement query;
    private ResultSet rs;
    JScrollPane jScrollPane1 = new JScrollPane();
    java.awt.GridBagLayout gridBagLayout1 = new GridBagLayout();

    public void jButton1_actionPerformed(ActionEvent e) {
        Connection con;
        Statement sql;
        ResultSet rs;
        Object a[][];

        Object columnName[]={"编码","姓名","性别","出生年月日","民族","文化程度","所在部门","参加工作时间","职称","基本工资","岗位工资","津贴工资"};
        a =new Object[60][4];
        try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        } catch (java.lang.ClassNotFoundException ee) {
            System.err.print("class not find!");
            System.err.println(ee.getMessage());
        }
        int i=0;
        while(i>0){
            a[i][0]="";
            a[i][1]="";
            a[i][2]="";
            a[i][3]="";
            a[i][4]="";
            a[i][5]="";
            a[i][6]="";
            a[i][7]="";
            a[i][8]="";
            a[i][9]="";
            a[i][10]="";
            a[i][11]="";
             i--;
            }
          i=0;

        try {
            con = DriverManager.getConnection("jdbc:odbc:scince", "", "");
            sql = con.createStatement();
            rs = sql.executeQuery("select * from 人员信息");
            while( rs.next()){
               jTextField1.setText(Integer.toString(rs.getInt(1)));
               jTextField2.setText(rs.getString(2));
               jTextField3.setText(rs.getString(3));
               jTextField4.setText(rs.getString(4));
               jTextField5.setText(rs.getString(5));
               jTextField6.setText(rs.getString(6));
               jTextField7.setText(rs.getString(7));
               jTextField8.setText(rs.getString(8));
               jTextField9.setText(rs.getString(9));
               jTextField10.setText(Integer.toString(rs.getInt(10)));
               jTextField11.setText(Integer.toString(rs.getInt(11)));
               jTextField12.setText(Integer.toString(rs.getInt(12)));

               String s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11;
              s0=rs.getString(1);
              a[i][0]=s0;
            s1=rs.getString(2);
            a[i][1]=s1;
            s2=rs.getString(3);
            a[i][2]=s2;
            s3=rs.getString(4);
            a[i][3]=s3;
            s4=rs.getString(5);
            a[i][4]=s4;
            s5=rs.getString(6);
            a[i][5]=s5;
            s6=rs.getString(7);
            a[i][6]=s6;

            s7=rs.getString(8);
            a[i][7]=s7;
            s8=rs.getString(9);
            a[i][8]=s8;
             s9=Integer.toString(rs.getInt(10));
            a[i][9]=s9;
            s10=Integer.toString(rs.getInt(11));
            a[i][10]=s10;
            s11=Integer.toString(rs.getInt(12));
            a[i][11]=s11;
           i++;
           System.out.print(s1);
           }

            con.close();
        } catch (SQLException ex) {}


    }



    class person_Info_jButton1_actionAdapter implements ActionListener {
        private person_Info adaptee;
        person_Info_jButton1_actionAdapter(person_Info adaptee) {
            this.adaptee = adaptee;
        }

        public void actionPerformed(ActionEvent e) {
            adaptee.jButton1_actionPerformed(e);
        }
    }


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -