NetBeans實(shí)現(xiàn)學(xué)生信息管理系統(tǒng)源碼

上傳人:1777****777 文檔編號(hào):38671680 上傳時(shí)間:2021-11-08 格式:DOC 頁(yè)數(shù):43 大?。?07KB
收藏 版權(quán)申訴 舉報(bào) 下載
NetBeans實(shí)現(xiàn)學(xué)生信息管理系統(tǒng)源碼_第1頁(yè)
第1頁(yè) / 共43頁(yè)
NetBeans實(shí)現(xiàn)學(xué)生信息管理系統(tǒng)源碼_第2頁(yè)
第2頁(yè) / 共43頁(yè)
NetBeans實(shí)現(xiàn)學(xué)生信息管理系統(tǒng)源碼_第3頁(yè)
第3頁(yè) / 共43頁(yè)

下載文檔到電腦,查找使用更方便

0 積分

下載資源

還剩頁(yè)未讀,繼續(xù)閱讀

資源描述:

《NetBeans實(shí)現(xiàn)學(xué)生信息管理系統(tǒng)源碼》由會(huì)員分享,可在線閱讀,更多相關(guān)《NetBeans實(shí)現(xiàn)學(xué)生信息管理系統(tǒng)源碼(43頁(yè)珍藏版)》請(qǐng)?jiān)谘b配圖網(wǎng)上搜索。

1、Developed by Group Name: Water Star Reg.No:R3P3000005 Sylvia Reg.No:R3P3000045 June Reg.No:R3P3000050 NIIT PROJECT ION StudentInformationManagementSystem Student Management System Software Batch Co

2、de: Start Date: 08/03/2013 Name of the Coordinator:Shahnawaz Ahmad Khan Name of the Developer: Ms.Water English Name: Water Name (Chinese & Ponyin): 水(water) End Date:14/03/2013 Date of Submission:18/03/2013 NIIT CERTIFICATE This is to certify that this report, titled

3、 "_Student Information Management System___", embodies the original work done by Peter In partial fulfillment of his course requirement at NIIT. Coordinator: Shahnawaz Ahmad Khan Associate Coordinator: Acknowledgement I would like to thank our Fa

4、culty Mr. Shahnawaz and Chinese associate Faculty Ms. Li Fanfan for all their guidance and support during the entire phase of this project development without which the project would not have been completed. System Analysis System Summary: It is convenient for the users to manage student in

5、formation.for example :add, delete,update and overview student information. Business Rules: 1,create database ,tables and constraints. 2,interface design 3,implement the source code 4,debug and test Data Query: create database SIMS use SIMS create table useinfo (uid int primary ke

6、y identity(101,1), uname nchar(20) not null, upassword nchar(10) default 00000, urealname nchar(20), umobil nchar(15) ) create table studentinfor (sid int primary key identity(10001,1), sname nchar(20) not null, sgender char(4), sbirthday nchar(15), smobil nchar(15), semil nchar

7、(20), sacademy nchar(20), smajor nchar(20), ) alter table useinfo add constraint uniq unique(uname) alter table studentinfor add constraint un unique(sname) alter table studentinfor alter column smobil char(11) alter table useinfo drop constraint DF__useinfo__upasswo__108B795B //How t

8、o Use Update、Insert、Select、delete in Code 1)stat=con.prepareStatement("update studentinfor set sgender=?,sbirthday=?,smobil=?,semil=?,sacademy=?,smajor=? where sid=?"); 2)stat=con.prepareStatement("insert into useinfo values(?,?,?,?)"); 3) ResultSet rs = stmt.executeQuery("SELECT * FROM useinfo")

9、; 4) stat=con.prepareStatement("delete from studentinfor where sid=?"); Interface Design for Student_Information Manager__ As the development of the computer, more and more management depend on the computer. For this reason,we group Water design a student information management for the stu

10、dent information management system.It is convenient for the manager to overview ,add, update,delete student information. Configuration Hardware: Intel (R) Pentium(R) Dual E2180 2.1G Hz 1.20G Hz 3.00GB RAM 250GB 7200 RPM Hard Disk 10/10

11、0NIC Optical Mouse Keyboard 17"Color Monitor Operating System: Microsoft Windows 07 Software: Netbeans IDE 7.2.1、Microsoft SQL Server 2008 Individual Project Schedule SrNo Activity Description Planned date of Completion Actual Date R

12、emarks 1 Create Database 09/03/2013 09/03/2013 No Problem 2 Interface Design 09/03/2013 09/03/2013 No Problem 3 Interface Implementation 11/03/2013 11/03/2013 No problem 4 Function Implementation 13/03/2013 11/03/2013 No problem 5 Debugging 13/03/2013 13/03/2013 Many Problem

13、s had been solved 6 7 8 9 10 11 Source Code //login GUI and the main function //StudentMain.java package studentinformationmanagementsystem; import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.sql.*; im

14、port javax.swing.UIManager; public class StudentMain extends JFrame implements ActionListener { JLabel Ltitle,Lname,Lpassword; JButton Blogin,Bexit,Lregister; JTextField TFname; JPasswordField TFpassword; GridBagLayout gbl; GridBagConstraints gbc; GridLayout gl;

15、 Font f1,f2,f3; JPanel p1,p2; Connection con; PreparedStatement stat; Statement stmt; ResultSet rs; public String name; public StudentMain(boolean flag) { //boolean f=f super("StudentInformationManagementSystem"); this.setDefault

16、CloseOperation(WindowConstants.EXIT_ON_CLOSE); f1=new Font("宋體",1,25); f2=new Font("宋體",1,20); f3=new Font("宋體",1,18); Ltitle=new JLabel("Student Information Management System",JLabel.CENTER); Ltitle.setVerticalAlignment(JLabel.CENTER); Ltitle.se

17、tForeground(Color.red); Lname=new JLabel("UserName",JLabel.CENTER); Lpassword=new JLabel("UserPassword",JLabel.CENTER); Lregister=new JButton("Register"); Ltitle.setFont(f1); Lname.setFont(f2); Lpassword.setFont(f2); Lregister.

18、setFont(f2); TFname=new JTextField(15); //TFname.setBounds(0,0,150,40); TFname.setFont(f2); TFpassword=new JPasswordField(15); TFpassword.setFont(f2); TFpassword.setEchoChar(*); Blogin=new JButton("Login"); Blogin.setF

19、ont(f2); Bexit=new JButton("Exit"); Bexit.setFont(f2); p1=new JPanel(); p2=new JPanel(); gbl=new GridBagLayout(); gbc=new GridBagConstraints(); gl=new GridLayout(3,1); p1.setLayout(gbl); gbc.fill=GridBagConstraints.NONE

20、; gbc.insets=new Insets(0,0,11,10); gbc.anchor=GridBagConstraints.CENTER; gbc.gridwidth=1; gbl.setConstraints(Lname, gbc); p1.add(Lname); gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.anchor=GridBagConstraints.LINE_START; gb

21、l.setConstraints(TFname, gbc); p1.add(TFname); gbc.gridwidth=1; gbc.anchor=GridBagConstraints.CENTER; gbl.setConstraints(Lpassword, gbc); p1.add(Lpassword); gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.anchor=GridBagConstr

22、aints.CENTER; gbl.setConstraints(TFpassword, gbc); p1.add(TFpassword); p2.setLayout(new FlowLayout(FlowLayout.CENTER,20,0)); p2.add(Blogin); p2.add(Bexit); p2.add(Lregister); this.setLayout(gl); this.add(Ltitle);

23、 this.add(p1); this.add(p2); Blogin.addActionListener(this); Bexit.addActionListener(this); Lregister.addActionListener(this); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); setBounds((screenSize.width-365)/2, (screenSize

24、.height-449)/2, 550, 350); this.setVisible(flag); } public void actionPerformed(ActionEvent ae) { if(ae.getActionCommand()=="Exit") System.exit(0); if(ae.getActionCommand()=="Login") { name=TFname.getText();

25、 String password=TFpassword.getText(); if(name.equals("")||password.equals("")) JOptionPane.showMessageDialog(null,"UserName,UserPassword is not null"); else{ try { Class.forName("sun.jdbc.odbc.JdbcOd

26、bcDriver"); con=DriverManager.getConnection("jdbc:odbc:DataSource","",""); Statement stmt=con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM useinfo"); boolean isfind=false; while(rs.next())

27、 { if(name.equals(rs.getString(2))) { isfind=true; if(password.equals( rs.getString(3))) { this.dispose(); new Fu

28、nction(name); TFname.setText(""); TFpassword.setText(""); } else { JOptionPane.showMessageDialog(null,"Password is worng!");

29、 } break; } } if( isfind==false) { JOptionPane.showMessageDialog(null,"Not Exsit the User,Please Register!"); } con.close();

30、 }catch(Exception e) { System.out.println("Error "+e.getMessage()); } } } if(ae.getActionCommand()=="Register") { new AddUser(); } } public static void main(String[]

31、args) { // TODO code application logic here try { UIManager.setLookAndFeel(new com.sun.java.swing.plaf.windows.WindowsLookAndFeel()); } catch(Exception e) { } new StudentMain(true); } } //Function GUI /

32、/Function.java package studentinformationmanagementsystem; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.sql.*; import javax.swing.table.*; import java.util.*; public class Function extends JFrame implements ActionListener { JMenu funmenu1,funmen

33、u2,funmenu3; JMenuItem menuitempwd,menulogout,menuexit,menuoverview; JPanel funpl1,funpl2,funpl3,funpl4,funpl5,funpl6; JLabel funlb1,funlb2; JButton funjbadd,funjbdelete,funjbupdate,funjboverview,funjbok,funjbcancel; JMenuBar funmenubar; JComboBox funjcb1; JTextFi

34、eld funjtf1,funjtf2; Font funf1; JScrollPane jsp; JTable funjtb; JScrollPane funjsp; Connection con; Statement stmt; PreparedStatement stat; ResultSet rs; ResultSetMetaData rsmd; public String ss; Function(String str) { super("Stu

35、dentManagementSystem"); this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); ss=str; setLayout(null); funjsp=new JScrollPane(); funf1=new Font("Arial",Font.BOLD|Font.ITALIC,20); funjcb1=new JComboBox(); funjcb1.addItem("select by ID");

36、 funjcb1.addItem("select by name"); funjcb1.addActionListener(this); funpl2=new JPanel(); funpl2.setLayout(new FlowLayout(FlowLayout.CENTER,0,3)); funpl3=new JPanel(); funpl3.setLayout(new FlowLayout(FlowLayout.LEFT,20,3)); funpl4=new JPanel();

37、 funpl4.setLayout(new FlowLayout(FlowLayout.CENTER,20,3)); funpl5=new JPanel(); funpl5.setLayout(new GridLayout(4,1)); funpl6=new JPanel(); funpl6.setLayout(new FlowLayout()); funmenubar=new JMenuBar(); funmenubar.setBounds(0,0,490,30); funlb1=new JLa

38、bel("Welcome To The System! ",JLabel.CENTER); funlb1.setFont(funf1); Object tablesize[][]=new Object[20][8]; for(int i=0;i<20;i++) { for(int j=0;j<8;j++) { tablesize[i][j]=null; } } String column[]={"sid","sname","sge

39、nder","sbirth","smobil","semil","sacademy","smajor"}; funjtb=new JTable(tablesize,column); funjtb.setShowGrid(true); funjtf1=new JTextField(25); funjtf1.addActionListener(this); funjbadd=new JButton("Add"); funjbadd.addActionListener(this); funjbdelet

40、e=new JButton("Delete"); funjbdelete.addActionListener(this); funjboverview=new JButton("Overview"); funjboverview.addActionListener(this); funjbupdate=new JButton("Update"); funjbupdate.addActionListener(this); funjbok=new JButton("OK"); funjbok.addA

41、ctionListener(this); funjbcancel=new JButton("Cancel"); funjbcancel.addActionListener(this); funmenu1=new JMenu("user management"); funmenu2=new JMenu(" overview"); funmenu3=new JMenu(" help"); menuoverview=new JMenuItem("check my infomation",JMenuItem.CEN

42、TER); menuoverview.addActionListener(this); menuitempwd=new JMenuItem("password management",JMenuItem.CENTER); menuitempwd.addActionListener(this); funmenu1.add(menuoverview); funmenu1.add(menuitempwd); menulogout=new JMenuItem("Log Out",JMenuItem.CENTER);

43、 menulogout.addActionListener(this); funmenu1.add(menulogout); menuexit=new JMenuItem("Exit",JMenuItem.CENTER); menuexit.addActionListener(this); funmenu1.add(menuexit); funmenubar.add(funmenu1); funmenubar.add(funmenu2); funmenubar.add(funmenu

44、3); funpl2.add(funlb1); funpl3.add(funjcb1); funpl3.add(funjtf1); funpl3.add(funjbok); funpl3.add(funjbcancel); funpl4.add(funjboverview); funpl4.add(funjbadd); funpl4.add(funjbdelete); funpl4.add(funjbupdate); fun

45、pl5.add(funpl2); funpl5.add(funpl3); funpl5.add(funpl4); funpl5.setBounds(0,50,475,120); funpl6.add(new JScrollPane(funjtb)); funpl6.setBounds(10,165,455,500); add(funmenubar); add(funpl5); add(funpl6); this.setVisible(true); Dime

46、nsion screenSize = Toolkit.getDefaultToolkit().getScreenSize(); setBounds((screenSize.width-450)/2, (screenSize.height-550)/2,490,580); } public void actionPerformed(ActionEvent ae) { //update password String s=ae.getActionCommand(); TableModel mdl=funjtb

47、.getModel(); if(ae.getSource().equals(menuitempwd)) { try{ UpdatePassword up=new UpdatePassword(); up.TFuname.setText(ss); }catch(Exception e) { System.out.println("Error: "+e); }

48、 } else if(ae.getSource().equals(funjboverview)) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:DataSource"); stmt=con.createStatement();

49、 rs=stmt.executeQuery("select * from studentinfor"); String rows[]={"","","","","","","",""}; while(rs.next()) { for(int i=0;i<8;i++) { rows[i]=rs.getString(i+1);

50、 mdl.setValueAt(rows[i], rs.getRow()-1, i); } } con.close(); funjtb.repaint(); } catch(Exception e) { System.out.println("Error:"+e); } } else if(ae.getSource

51、().equals(menuoverview)) { try { con=DriverManager.getConnection("jdbc:odbc:DataSource"); stmt=con.createStatement(); rs=stmt.executeQuery("select uid,uname,urealname,umobil from useinfo where uname="+ss+"");

52、 rs.next(); String id=Integer.toString(rs.getInt(1)); String name=rs.getString(2); String realname=rs.getString(3); String mobil=rs.getString(4); UserInformation ui=new UserInformation(true); ui.TFuid

53、.setText(id); ui.TFuname.setText(name); ui.TFurealname.setText(realname); ui.TFumobil.setText(mobil); con.close(); }catch(Exception e) { System.out.println("Error: "+e);

54、 } } else if(ae.getSource().equals(menulogout)) { this.dispose(); new StudentMain(true); } else if(ae.getSource().equals(menuexit)) { System.exit(1); } else if(ae.getSource() == funjbok)

55、 { if(funjtf1.getText().equals("")) { JOptionPane.showMessageDialog(null, "Please Input The StudentID or StudentName"); } else if (funjcb1.getSelectedItem().equals("select by ID")) { int sid=Integer.parseInt(fu

56、njtf1.getText()); try { con=DriverManager.getConnection("jdbc:odbc:DataSource"); stmt=con.createStatement(); rs=stmt.executeQuery("select * from studentinfor where sid="+sid); String rows

57、[]={"","","","","","","",""}; if(rs.next()) { int id=rs.getInt(1); String ID=Integer.toString(id); String name=rs.getString(2); String gender=rs.getString(3);

58、 String birth=rs.getString(4); String mobil=rs.getString(5); String email=rs.getString(6); String academy=rs.getString(7); String major=rs.getString(8);

59、 StudentInformation si=new StudentInformation(); si.TFid.setText(ID); si.TFname.setText(name); si.TFsex.setText(gender); si.TFbirthday.setText(birth); si.TFmobil.setText(mobil

60、); si.TFemail.setText(email); si.TFacademy.setText(academy); si.TFmajor.setText(major); } else { JOptionPane.showMessageDialog(null, "Che

61、ck The ID Again!"); } con.close(); } catch(Exception e) { System.out.println("Error:"+e); } } else if (funjcb1.getSelectedItem().equals("select b

62、y name")) { try { con=DriverManager.getConnection("jdbc:odbc:DataSource"); stmt=con.createStatement(); rs=stmt.executeQuery("select * from studentinfor where sname="+funjtf1.getText()+""); String

63、 rows[]={"","","","","","","",""}; rsmd=rs.getMetaData(); if(rs.next()) { int id=rs.getInt(1); String ID=Integer.toString(id); String name=rs.getString(2); String

64、 gender=rs.getString(3); String birth=rs.getString(4); String mobil=rs.getString(5); String email=rs.getString(6); String academy=rs.getString(7); String major=rs.getString(8);

65、 StudentInformation si=new StudentInformation(); si.TFid.setText(ID); si.TFname.setText(name); si.TFsex.setText(gender); si.TFbirthday.setText(birth); si.TFmobil.setText(mobil);

66、 si.TFemail.setText(email); si.TFacademy.setText(academy); si.TFmajor.setText(major); } else { JOptionPane.showMessageDialog(null, "Check The Name Again!"); } con.close(); funjtb.repaint(); funjtb.updateUI(); } catch(Exception e) { System

展開(kāi)閱讀全文
溫馨提示:
1: 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
2: 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
3.本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
5. 裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

相關(guān)資源

更多
正為您匹配相似的精品文檔
關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號(hào):ICP2024067431號(hào)-1 川公網(wǎng)安備51140202000466號(hào)


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺(tái),本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng),我們立即給予刪除!