Java学生管理系统设计与实现 (超详细,含课程设计)
最新文章出爐,歡迎點評
它曾是瀏覽器的王者,如今卻前景堪憂......? ?推薦閱讀?★★★★
往期文章回顧:
1、Java開發崗位面試題匯總(不斷補充……)★★★
2、Java程序員必須掌握的英語詞組?★★
3、學習Java的9張思維導圖?★★★★★
一直收藏著的管理系統設計報告,受益匪淺,希望也可以幫助到你。
功能分析
本系統面向某高校的所有大學生的基本信息管理,主要分為學生基本信息管理、學生成績信息管理、學生學籍信息管理和統計報表管理四大部分。
(1) 學生基本信息管理
學生基本信息管理完成學生基本信息(學號、姓名、性別等信息)的各種數據庫管理操作。
學生的基本信息由教務人員錄入,系統需要對信息進行核對然后保存到學生基本信息數據庫中,學生本人可以根據學號或個人帳號登錄瀏覽自己的基本信息。
學生可以根據系統提出更新請求,更新請求匯總為待更新學生基本信息,并由教務人員統一修改。
班主任只能瀏覽本班學生的基本信息,學院主管學生工作的領導則可以查看全院所有學生的基本信息。
若學生出現退學、修學等情況,班主任將這些同學的信息給教務人員,由教務人員統一刪除或修改。
(2) 學生成績管理
學生的成績信息管理包括學生成績的錄入、查詢、刪除、修改等操作,學生成績由教務處人員負責錄入和修改。
學生本人及班主任擁有不同的權限,可以憑學號或班級編號查看一個或多個學生的成績信息。
學工處制定獎學金頒發準則,每學期都根據學生成績評選出符合獎學金要求的學生名單,打印出交學校主管部門審批。
此外,教務處人員還可根據學生成績及每名學生選修學分的多少確定退學名單和留級名單,打印出交學校主管部門審批。
(3) 學生的學籍管理
學生的學籍信息管理其實和第1和第2個功能緊密聯系。
主要完成如下功能:學生入學的學籍登記、學生休學的學籍保留、學生留級的學籍信息更新、學生復學的學籍激活、學生退學的學籍清除等工作。
(4) 統計報表管理
學校教務處可以對學生基本信息、學生成績信息、學生學籍信息進行分類匯總,形成各種統計報表。如單門課程的及格率、學生獲取獎學金的比率等。
概要設計
處理流程
?軟件結構
整體測試
登錄
新增賬戶界面
代碼:
DisplayStudent:
import java.awt.*; import java.sql.*; import java.util.*; import javax.swing.*;public class DisplayStudent extends JFrame {static final String JDBC_DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";static final String DATABASE_URL = "jdbc:odbc:studyDSN";private Connection connection;private Statement statement;public DisplayStudent(){super("顯示全部學生信息");try{Class.forName(JDBC_DRIVER);connection = DriverManager.getConnection(DATABASE_URL,"sa","8882551");statement = connection.createStatement();String sqlString = new String("select std_no as 學號,std_name as 姓名,std_sex as 性別,age as 年齡,std_sdept as 所在系,std_condition as 學籍狀態 from student1");ResultSet resultSet = statement.executeQuery(sqlString);StringBuffer results = new StringBuffer();ResultSetMetaData metaData = resultSet.getMetaData();int numberOfColumns = metaData.getColumnCount();for (int i = 1; i <= numberOfColumns; i++)results.append(metaData.getColumnName(i)+"\t");results.append("\n");while(resultSet.next()){for (int i = 1; i <= numberOfColumns; i++)results.append(resultSet.getObject(i)+"\t");results.append("\n");}JTextArea textArea = new JTextArea(results.toString());textArea.setEditable(false);Container container = getContentPane();container.add(new JScrollPane(textArea));setSize(500,400);setVisible(true);}catch(SQLException sqlException){JOptionPane.showMessageDialog(null,sqlException.getMessage(),"Database Error",JOptionPane.ERROR_MESSAGE);System.exit(1);}catch(ClassNotFoundException classNotFound){JOptionPane.showMessageDialog(null,classNotFound.getMessage(),"Driver Not Found",JOptionPane.ERROR_MESSAGE);System.exit(1);}finally {try{statement.close();connection.close();}catch(SQLException sqlException){JOptionPane.showMessageDialog(null,sqlException.getMessage(),"Database Error",JOptionPane.ERROR_MESSAGE);System.exit(1);}}}public static void main(String args[]){DisplayStudents window = new DisplayStudents();window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);} }Login:
/*導入JDK包*/ import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.sql.*; import java.util.*; /**/ public class Login extends JFrame{ private JTextField tfUser,password;private String tfUser1,password1;static final String JDBC_DRIVER="sun.jdbc.odbc.JdbcOdbcDriver";static final String DATABASE_URL="jdbc:odbc:studyDSN";private Connection connection;private Statement statement;String sqlString;public Login(){super("學生信息管理系統登陸窗口--王輝(05計算機二班)6號");initialize();Box horizontal1=Box.createHorizontalBox();Box horizontal2=Box.createHorizontalBox();Box horizontal3=Box.createHorizontalBox();Box horizontal4=Box.createHorizontalBox();Box horizontal5=Box.createHorizontalBox();Box horizontal6=Box.createHorizontalBox();Box horizontal7=Box.createHorizontalBox();Box vertical1=Box.createVerticalBox();Box vertical2=Box.createVerticalBox(); Container container=getContentPane();container.setLayout(new FlowLayout());JLabel lbTitle=new JLabel("學生信息管理系統入口");lbTitle.setFont(new Font("",Font.BOLD,18));horizontal1.add(lbTitle);JLabel lbUser3=new JLabel(" ");horizontal7.add(lbUser3);horizontal7.setSize(300,15);//container.add(lbTitle);JLabel lbUser=new JLabel("用戶名:");horizontal2.add(lbUser);//container.add(lbUser);final JTextField tfUser=new JTextField(10);horizontal2.add(tfUser); //container.add(tfUser);JLabel lbUser2=new JLabel(" ");horizontal6.add(lbUser2);horizontal6.setSize(300,15); JLabel lbpassword=new JLabel("密碼:");horizontal3.add(lbpassword);//container.add(lbpassword); final JPasswordField password=new JPasswordField(10);horizontal3.add(password);vertical1.add(horizontal7);vertical1.add(horizontal2);vertical1.add(horizontal6);vertical1.add(horizontal3);JLabel lbUser1=new JLabel(" ");horizontal5.add(lbUser1);horizontal5.setSize(300,15);//container.add(password);/*添加按鈕監聽*/ JButton InButton=new JButton("登陸");horizontal4.add(InButton); InButton.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent event){ tfUser1=tfUser.getText();password1=password.getText(); check(tfUser1,password1); }});JLabel lbUser5=new JLabel(" ");horizontal4.add(lbUser5);//container.add(InButton);JButton ClearButton=new JButton("重置");ClearButton.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent event){ tfUser.setText("");password.setText("");}});horizontal4.add(ClearButton);//container.add(ClearButton);vertical2.add(horizontal1);vertical2.add(vertical1);vertical2.add(horizontal5);vertical2.add(horizontal4); container.add(vertical2);setSize(500,200);setVisible(true);/*按鈕監聽實現*/ }/*判斷用戶名密碼*/public void check(String tfUser0,String password0){ if(tfUser0.equals("")){ JOptionPane.showMessageDialog(null,"請輸入用戶名","IOError",JOptionPane.ERROR_MESSAGE); } else if(password0.equals("")){JOptionPane.showMessageDialog(null,"請輸入密碼","IOError",JOptionPane.ERROR_MESSAGE);}else if(tfUser0.equals("ecjtu")&&password0.equals("ecjtu")){new Student(0); setVisible(false);}else{try{String sqlString="select * from admin where adminusername='"+tfUser0+"' and adminpassword='"+password0+"'";ResultSet resultSet=statement.executeQuery(sqlString); if(resultSet.next()){new Student(1); setVisible(false);}else{JOptionPane.showMessageDialog(this,"Wrong Username Or Password","IOError",JOptionPane.ERROR_MESSAGE);}}catch(NumberFormatException formatException){JOptionPane.showMessageDialog(this,"Bad sno number","Invalid Number Format",JOptionPane.ERROR_MESSAGE);}catch(SQLException sqlException){System.out.println(sqlException);}} }/*數據庫連接*/public void initialize(){try{Class.forName(JDBC_DRIVER);connection = DriverManager.getConnection(DATABASE_URL,"sa","8882551");statement = connection.createStatement();}catch(SQLException sqlException){JOptionPane.showMessageDialog(null,sqlException.getMessage(),"Database Error",JOptionPane.ERROR_MESSAGE);System.exit(1);}catch(ClassNotFoundException classNotFound){JOptionPane.showMessageDialog(null,classNotFound.getMessage(),"Driver Not Found",JOptionPane.ERROR_MESSAGE);System.exit(1);}}//end initialize public static void main(String[] args){Login login=new Login(); } } //class checkException extends Exception{ // public checkException(String msg) // { // super(msg); // } //}相關文章推薦:
1、?C語言學生成績管理系統源代碼?★★★★★
2、?C語言學籍管理系統源代碼?★★
3、C語言學生成績管理系統設計 《C語言程序設計》實訓報告?★★★
4、C語言員工信息管理系統源代碼?★★★
5、C語言學生信息管理系統源代碼?★★
?感謝你的關注與閱讀,想要更多學習資料的朋友可以加VX:Pandaxiaonian 交流學習?
總結
以上是生活随笔為你收集整理的Java学生管理系统设计与实现 (超详细,含课程设计)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: x210开发板的三种启动方式(三星推荐的
- 下一篇: [下载]Windows 10测试版的新版