Professional Documents
Culture Documents
Student Management System: Java Mini Project Report
Student Management System: Java Mini Project Report
Student Management System: Java Mini Project Report
Submitted by
A.NAGARAJAN (9916008033)
S.VIGNESH (9916008056)
V.VIKRAM KISHORE (9916008058)
M.LOGESHWARAN (9916008059)
of
BACHELOR OF TECHNOLOGY
In
INFORMATION TECHNOLOGY
(DEEMED TO BE UNIVERSITY)
1
KALASALINGAM ACADEMY OF RESEARCH AND EDUCATION
(DEEMED TO BE UNIVERSITY)
BONAFIDE CERTIFICATE
Certified that this project report “STUDENT MANAGEMENT SYSTEM” is the bonafide work of
“A.NAGARAJAN (9916008033), S.VIGNESH (9916008056), V.VIKRAM KISHORE
(9916008058), M.LOGESHWARAN (9916008059)” who carried out the project work under my
supervision.
2
ACKNOWLEDGEMET
3
ABSTRACT
Students form a main part of any institution that concerns with. But the institutions find it
difficult to keep details of so many students of the organization just in one stretch. It will
involve a lot of pen paper work. Sometimes there will be some huge heap of files bundled up
and kept together in some corner of the office. If you want any information regarding the
particular student then it can be obtained by just entering the roll number or the name of the
student to be searched. This student management system will make the work of storing the data
in an organized way.
The student management system application will help in managing the student’s reports, results
and exams will become easier with one such system. It will also help in saving time and effort.
The user interface must be user friendly and easy to understand. The information of the
particular student will be obtained in just one mouse click.
Some of the features that it can include are as follows:
Student database management: The details of the students of the organizations can be stored in
the database with the use this application.
Results: The results of the students can also be accessed and stored through this application.
Security: The data that will be disclosed will be more secure since there will be no access to
the unknown users.
Performance: The performance of the students might be in curriculum as well as co-curriculum
can also be stored through the use of this application.
One-click access: You will obtain the details of the students by entering his/her name or the
roll number just in one click.
User interface: The user interface must be simple and easy to understand.
Personal details: All the personal details of the students can be obtained in just one mouse click.
4
TABLE OF CONTENT
5
1. INTRODUCTION
Student Management System is software which is helpful for students as well as the
school authorities. In the current system all the activities are done manually. It is very time
consuming and costly. Our Student Management System deals with the various activities
related to the students.
There are mainly 3 modules in this software
• User module
• Student Module
• Mark management
In the Software we can register as a user and user has of two types, student and
administrator. Administrator has the power to add new user and can edit and delete a user. A
student can register as user and can add edit and delete his profile. The administrator can add
edit and delete marks for the student. All the users can see the marks.
6
2. EXISTING SYSTEM
In the current system we need to keep a number of records related to the student and
want to enter the details of the student and the marks manually. In this system only the teacher
or the school authority views the mark of the student and they want to enter the details of the
student. This is time consuming and has much cost.
7
3. PROPOSED SYSTEM
In our proposed system we have the provision for adding the details of the students by
themselves. So the overhead of the school authorities and the teachers is become less. Another
advantage of the system is that it is very easy to edit the details of the student and delete a
student when it found unnecessary. The marks of the student are added in the database and so
students can also view the marks whenever they want.
Our proposed system has several advantages
All the manual difficulties in managing the student details in a school or college have
been rectified by implementing computerization.
4. FEASIBILITY ANALYSIS
Whatever we think need not be feasible. It is wise to think about the feasibility of any
problem we undertake. Feasibility is the study of impact, which happens in the organization by
the development of a system. The impact can be either positive or negative. When the positives
nominate the negatives, then the system is considered feasible. Here the feasibility study can
be performed in two ways such as technical feasibility and Economical Feasibility.
8
4.1 TECHNICAL FEASIBILITY
We can strongly says that it is technically feasible, since there will not be much
difficulty in getting required resources for the development and maintaining the system as well.
All the resources needed for the development of the software as well as the maintenance of the
same is available in the organization here we are utilizing the resources which are available
already.
5. CONFIGURATIONS
9
5.2 SOFTWARE CONFIGURATION
6. DATA TYPE
10
7. SYSTEM IMPLEMENTATION
Implementation is the stage in the project where the theoretical design is turned into a
working system. The implementation phase constructs, installs and operates the new system.
The most crucial stage in achieving a new successful system is that it will work efficiently and
effectively.
There are several activities involved while implementing a new project.
They are
➢ End user training
➢ End user Education
➢ Training on the application software
➢ System Design
➢ Parallel Run and To New System
➢ Post implementation Review
The successful implementation of the new system will purely upon the involvement of
the officers working in that department. The officers will be imparted the necessary training on
the new technology.
11
7.3 TRAINING OF APPLICATION SOFTWARE
After providing the necessary basic training on the computer awareness, the users will
have to be trained upon the new system such as the screen flows and screen design type of help
on the screen, type of errors while entering the data, the corresponding validation check at each
entry and the way to correct the data entered. It should then cover information needed by the
specific user or group to use the system.
8. SOFTWARE TESTING
Is the menu bar displayed in the appropriate contested some system related features
included either in menus or tools? Do pull –Down menu operation and Tool-bars work
properly? Are all menu function and pull down sub function properly listed? ; Is it possible to
invoke each menu function using a logical assumptions that if all parts of the system are correct,
the goal will be successfully achieved? In adequate testing or non-testing will leads to errors
that may appear few months later.
This create two problem
➢ Time delay between the cause and appearance of the problem.
➢ The effect of the system errors on files and records within the system.
The purpose of the system testing is to consider all the likely variations to which it will
be suggested and push the systems to limits.
The testing process focuses on the logical intervals of the software ensuring that all
statements have been tested and on functional interval is conducting tests to uncover errors and
ensure that defined input will produce actual results that agree with the required results.
Program level testing, modules level testing integrated and carried out.
There are two major type of testing they are
➢ White Box Testing.
➢ Black Box Testing.
12
8.1 WHITE BOX TESTING
White box some times called “Glass box testing” is a test case design uses the control
structure of the procedural design to drive test case.
Using white box testing methods, the following tests where made on the system
a) All independent paths within a module have been exercised once. In our system, ensuring
that case was selected and executed checked all case structures. The bugs that were prevailing
in some part of the code where fixed
b) All logical decisions were checked for the truth and falsity of the values.
13
9. CODING
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
Container c = getContentPane();
private JButton btnLogin, btnCancel;
private JLabel lblUName, lblPasswd;
private JTextField txtUName;
private JPasswordField txtPasswd;
public Login() {
super("Login ...");
this.setSize(350, 200);
this.setLayout(null);
this.setResizable(false);
this.setLocation((Settings.getScreenSize().width / 2) - 175, (Settings.getScreenSize().height /
2) - 150);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
14
lblUName = new JLabel("Username");
lblPasswd = new JLabel("Password");
txtUName = new JTextField();
txtPasswd = new JPasswordField();
btnLogin = new JButton("Login", new
ImageIcon(ClassLoader.getSystemResource("Images/login.png")));
btnCancel = new JButton("Cancel",new
ImageIcon(ClassLoader.getSystemResource("Images/cancel.png")));
lblUName.setBounds(50, 40, 140, 25);
txtUName.setBounds(150, 40, 130, 25);
lblPasswd.setBounds(50, 80, 140, 25);
txtPasswd.setBounds(150, 80, 130, 25);
btnLogin.setBounds(50, 120, 100, 25);
btnCancel.setBounds(180, 120, 100, 25);
btnLogin.addActionListener(this);
btnCancel.addActionListener(this);
this.add(lblUName);
this.add(lblPasswd);
this.add(txtUName);
this.add(txtPasswd);
this.add(btnLogin);
this.add(btnCancel);
}//constructor closed
public void actionPerformed(ActionEvent e) {
if (e.getSource() == btnLogin) {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:student");
try {
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("SELECT * FROM UAD WHERE Username='" +
txtUName.getText() +
"' and Password='" + txtPasswd.getText() + "'");
if (rs.next()) {
15
if (rs.getString(3).equals("Student")) {
userMDI frm = new userMDI();
frm.setVisible(true);
} else {
new frmAdminMDI().setVisible(true);
}
this.dispose();
}else{
JOptionPane.showMessageDialog(null,"Invalid username or
password","Invalid",JOptionPane.ERROR_MESSAGE);
}
con.close();
if (e.getSource() == btnCancel) {
System.exit(0);
}//if closed
}//actionPerformed() closed
public static void main(String args[]) {
new Login().setVisible(true);
}
}//class closed
import java.awt.event.ActionEvent;
16
import java.awt.event.ActionListener;
import java.sql.Statement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPasswordField;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public NewUserReg() {
super("User registration", false, true, false, true);
this.setLayout(null);
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
this.setLocation(300, 175);
this.setSize(350, 300);
17
group = new ButtonGroup();
rdoStudent = new JRadioButton("Student");
rdoAdmin = new JRadioButton("Administrator");
lblUsername = new JLabel("User name");
lblPassword = new JLabel("Enter the password");
lblCPassword = new JLabel("Confirm password");
txtUsername = new JTextField();
txtPassword = new JPasswordField();
txtCPassword = new JPasswordField();
btnSave = new JButton("Save", new
ImageIcon(ClassLoader.getSystemResource("Images/save.png")));
lblUsername.setBounds(30, 30, 100, 30);
lblPassword.setBounds(30, 80, 150, 30);
lblCPassword.setBounds(30, 130, 150, 30);
txtUsername.setBounds(150, 30, 150, 25);
txtPassword.setBounds(150, 80, 150, 25);
txtCPassword.setBounds(150, 130, 150, 25);
rdoStudent.setBounds(60, 170, 100, 30);
rdoAdmin.setBounds(170, 170, 150, 30);
btnSave.setBounds(120, 210, 100, 25);
group.add(rdoAdmin);
group.add(rdoStudent);
add(lblUsername);
add(lblPassword);
add(lblCPassword);
add(txtUsername);
add(txtPassword);
add(txtCPassword);
add(rdoStudent);
add(rdoAdmin);
add(btnSave);
btnSave.addActionListener(this);
rdoStudent.setSelected(true);
}//constructor closed
18
public void actionPerformed(ActionEvent e) {
String Type;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:student");
Statement st = con.createStatement();
try {
if (e.getSource() == btnSave) {
String Username = txtUsername.getText();
String Password = txtPassword.getText();
String CPassword = txtCPassword.getText();
if (!CPassword.equals(Password)) {
JOptionPane.showMessageDialog(null, "Password and Confirm Password fields does not
match", "Error", JOptionPane.ERROR_MESSAGE);
return;
}
String str = "insert into UAD(Username,Password,Type) values(?,?,?)";
PreparedStatement ps = con.prepareStatement(str);
if (rdoStudent.isSelected()) {
Type = "Student";
} else {
Type = "Admin";
}
ps.setString(1, Username);
ps.setString(2, Password);
ps.setString(3, Type);
ps.executeUpdate();
JOptionPane.showMessageDialog(null, "Database successfully updated", "Success",
JOptionPane.INFORMATION_MESSAGE);
txtUsername.setText("");
txtPassword.setText("");
txtCPassword.setText("");
}//if Closed
} catch (Exception x) {
19
JOptionPane.showMessageDialog(null, "Error,Unable to perform database operation",
"Error", JOptionPane.ERROR_MESSAGE);
}//inner try catch closed
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "Error on database connection, Cannot perform
database operation", "Error", JOptionPane.ERROR_MESSAGE);
}//outer try catch closed
}//actionPerformed() closed
}//class closed
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
public Deleteuser() {
super("Delete user accounts", false, true, false, true);
setBounds(350, 200, 300, 200);
20
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setLayout(null);
lblUName.setBounds(30, 30, 100, 30);
cmbUName.setBounds(120, 30, 130, 25);
btnDelete.setBounds(100, 90, 100, 25);
add(lblUName);
add(cmbUName);
add(btnDelete);
btnDelete.addActionListener(this);
LoadUserames();
}
21
}//outer try catch closed
}//actionPerformed() closed
private void LoadUserames() {
String name;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:student");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select Username from UAD");
cmbUName.removeAllItems();
while (rs.next()) {
name=rs.getString(1);
if (!(name.equalsIgnoreCase("admin"))) {
cmbUName.addItem(name);
}
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "Error while loading users list, Closing window" +
ex.toString());
this.dispose();
}//try catch clsoed
}
}//class closed
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.Statement;
import javax.swing.ImageIcon;
import javax.swing.JButton;
22
import javax.swing.JComboBox;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
public NewStdReg() {
super("New Student Registration", true, true, true, true);
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
this.setSize(1000, 1000);
23
lblOccupation = new JLabel("Occupation");
lblMotherName = new JLabel("Mother's name");
lblDOB = new JLabel("DOB");
lblAge = new JLabel("Age");
lblCaste = new JLabel("Caste");
lblReligion = new JLabel("Religion");
lblHouseName = new JLabel("House Name");
lblCity = new JLabel("City");
lblDistrict = new JLabel("District");
lblState = new JLabel("State");
lblPin = new JLabel("Pin");
lblYear = new JLabel("Year");
lblQualification = new JLabel("Qualification");
24
txtQualification = new JTextField();
txtYear = new JTextField();
panel.setLayout(null);
25
lblAge.setBounds(500, 90, 150, 25);
txtAge.setBounds(600, 90, 200, 25);
lblReligion.setBounds(500, 130, 100, 25);
txtReligion.setBounds(600, 130, 200, 25);
lblHouseName.setBounds(500, 170, 100, 25);
txtHouseName.setBounds(600, 170, 200, 25);
lblCity.setBounds(500, 210, 150, 25);
txtCity.setBounds(600, 210, 200, 25);
lblDistrict.setBounds(500, 250, 100, 25);
txtDistrict.setBounds(600, 250, 200, 25);
lblState.setBounds(500, 290, 50, 25);
txtState.setBounds(600, 290, 200, 25);
lblPin.setBounds(500, 330, 150, 25);
txtPin.setBounds(600, 330, 200, 25);
lblYear.setBounds(500, 370, 100, 25);
txtYear.setBounds(600, 370, 200, 25);
lblQualification.setBounds(100, 420, 80, 25);
txtQualification.setBounds(200, 420, 600, 25);
panel.add(lblAdNo);
panel.add(txtAdNo);
panel.add(lblName);
panel.add(txtName);
panel.add(lblPhNo);
panel.add(txtPhNo);
panel.add(lblSex);
panel.add(cmbSex);
panel.add(lblFatherName);
panel.add(txtFatherName);
panel.add(lblOccupation);
26
panel.add(txtOccupation);
panel.add(lblMotherName);
panel.add(txtMotherName);
panel.add(lblDOB);
panel.add(txtDOB);
panel.add(lblAge);
panel.add(txtAge);
panel.add(lblCaste);
panel.add(txtCaste);
panel.add(lblReligion);
panel.add(txtReligion);
panel.add(lblHouseName);
panel.add(txtHouseName);
panel.add(lblCity);
panel.add(txtCity);
panel.add(lblDistrict);
panel.add(txtDistrict);
panel.add(lblState);
panel.add(txtState);
panel.add(lblPin);
panel.add(txtPin);
panel.add(txtYear);
panel.add(lblYear);
panel.add(lblQualification);
panel.add(txtQualification);
panel.add(btnSave);
panel.add(btnCancel);
panel.add(btnClear);
add(panel, BorderLayout.CENTER);
//getAdmissionNo();
}//constructor closed
27
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equalsIgnoreCase("Save")) {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:student");
try {
String str = "insert into student(RollNo,SName,Phno,Sex,FName,Occupation," +
"MName,Dob,Age,Caste,Religion,Hname,City,District,State,pin,Year,Qualification)" +
" values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
PreparedStatement ps = con.prepareStatement(str);
ps.setString(1, txtAdNo.getText());
ps.setString(2, txtName.getText());
ps.setString(3, txtPhNo.getText());
ps.setString(4, cmbSex.getSelectedItem().toString());
ps.setString(5, txtFatherName.getText());
ps.setString(6, txtOccupation.getText());
ps.setString(7, txtMotherName.getText());
ps.setString(8, txtDOB.getText());
ps.setString(9, txtAge.getText());
ps.setString(10, txtCaste.getText());
ps.setString(11, txtReligion.getText());
ps.setString(12, txtHouseName.getText());
ps.setString(13, txtCity.getText());
ps.setString(14, txtDistrict.getText());
ps.setString(15, txtState.getText());
ps.setString(16, txtPin.getText());
ps.setString(17, txtYear.getText());
ps.setString(18, txtQualification.getText());
ps.executeUpdate();
JOptionPane.showMessageDialog(null, "Registration details successfully updated",
"Success", JOptionPane.INFORMATION_MESSAGE);
ClearForm();
} catch (Exception x) {
28
JOptionPane.showMessageDialog(null, "Error on database operation,Updation failure",
"Error", JOptionPane.ERROR_MESSAGE);
}//inner try catch closed
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "Error on connection to database, cannot continue
updation process", "Error", JOptionPane.ERROR_MESSAGE);
}//outer try catch closed
}//if closed
if (e.getActionCommand().equalsIgnoreCase("Clear")) {
ClearForm();
}//if closed
if (e.getActionCommand().equalsIgnoreCase("Cancel")) {
this.dispose();
}//if closed
}
29
txtQualification.setText("");
}//clearform() closed
/*private void getAdmissionNo() {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:student");
try {
st = con.createStatement();
ResultSet rs = st.executeQuery("SELECT MAX(RollNo) FROM student");
JOptionPane.showMessageDialog(null, "ttt");
if (rs.next()) {
int no=Integer.parseInt(rs.getString(0));
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Error on retrieving admission number" +
e.toString(), "Error", JOptionPane.ERROR_MESSAGE);
}//inner try closed
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "Error on database connection, Closing window",
"Error", JOptionPane.ERROR_MESSAGE);
}//try catch closed
}//getAdmissionNo() closed*/
}//class closed
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.ImageIcon;
import javax.swing.JButton;
30
import javax.swing.JComboBox;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
public EditStdReg() {
super("Edit Student Registration", true, true, true, true);
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
this.setSize(1000, 1000);
31
lblFatherName = new JLabel("Father's name");
lblOccupation = new JLabel("Occupation");
lblMotherName = new JLabel("Mother's name");
lblDOB = new JLabel("DOB");
lblAge = new JLabel("Age");
lblCaste = new JLabel("Caste");
lblReligion = new JLabel("Religion");
lblHouseName = new JLabel("House Name");
lblCity = new JLabel("City");
lblDistrict = new JLabel("District");
lblState = new JLabel("State");
lblPin = new JLabel("Pin");
lblYear = new JLabel("Year");
lblQualification = new JLabel("Qualification");
32
txtPin = new JTextField();
txtQualification = new JTextField();
txtYear = new JTextField();
panel.setLayout(null);
33
panel.add(btnView);
add(panel, BorderLayout.CENTER);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:student");
st = con.createStatement();
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "Error on connection to database, cannot continue
updation process", "Error", JOptionPane.ERROR_MESSAGE);
}//outer try catch closed
}//constructor closed
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equalsIgnoreCase("Update")) {
try {
if(adno!=Integer.parseInt(txtAdNo.getText())){
JOptionPane.showMessageDialog(null,"Roll number cannot be changed","Updation
error",JOptionPane.ERROR_MESSAGE);
return;
}
String sql = "UPDATE student SET
SName=?,Phno=?,Sex=?,Fname=?,Occupation=?,Mname=?,Dob=?" +
",Age=?,Caste=?,Religion=?,Hname=?,City=?,District=?,State=?,Pin=?,Year=?,Qualification
=?" +
" WHERE Rollno="+ adno;
ps=con.prepareStatement(sql);
ps.setString(1,txtName.getText());
ps.setString(2,txtPhNo.getText());
ps.setString(3,cmbSex.getSelectedItem().toString());
ps.setString(4,txtFatherName.getText());
ps.setString(5,txtOccupation.getText());
ps.setString(6,txtMotherName.getText());
ps.setString(7,txtDOB.getText());
34
ps.setInt(8,Integer.parseInt(txtAge.getText()));
ps.setString(9,txtCaste.getText());
ps.setString(10,txtReligion.getText());
ps.setString(11,txtHouseName.getText());
ps.setString(12,txtCity.getText());
ps.setString(13,txtDistrict.getText());
ps.setString(14,txtState.getText());
ps.setString(15,txtPin.getText());
ps.setInt(16,Integer.parseInt(txtYear.getText()));
ps.setString(17,txtQualification.getText());
ps.executeUpdate();
JOptionPane.showMessageDialog(null, "Registration details successfully updated",
"Success", JOptionPane.INFORMATION_MESSAGE);
ClearForm();
btnUpdate.setEnabled(false);
} catch (Exception x) {
JOptionPane.showMessageDialog(null, "Error on database operation,Updation failure",
"Error", JOptionPane.ERROR_MESSAGE);
}//inner try catch closed
}//if closed
if (e.getActionCommand().equalsIgnoreCase("View")) {
try {
ResultSet rs = st.executeQuery("SELECT * FROM student WHERE RollNo=" +
txtAdNo.getText());
if (rs.next()) {
adno = Integer.parseInt(txtAdNo.getText());
txtName.setText(rs.getString("SName"));
cmbSex.setSelectedItem(rs.getString("Sex"));
txtFatherName.setText(rs.getString("FName"));
txtMotherName.setText(rs.getString("MName"));
txtAge.setText(rs.getString("Age"));
txtOccupation.setText(rs.getString("Occupation"));
txtPhNo.setText(rs.getString("phno"));
35
txtReligion.setText(rs.getString("Religion"));
txtHouseName.setText(rs.getString("Hname"));
txtCaste.setText(rs.getString("Caste"));
txtCity.setText(rs.getString("City"));
txtState.setText(rs.getString("State"));
txtDOB.setText(rs.getDate("Dob").toString());
txtDistrict.setText(rs.getString("District"));
txtPin.setText(rs.getString("Pin"));
txtYear.setText(rs.getString("Year"));
txtQualification.setText(rs.getString("Qualification"));
btnUpdate.setEnabled(true);
} else {
JOptionPane.showMessageDialog(null, "Roll No not found in database", "Not found",
JOptionPane.INFORMATION_MESSAGE);
ClearForm();
btnUpdate.setEnabled(false);
}//if else closed
} catch (Exception x) {
JOptionPane.showMessageDialog(null, "Error on database operation,Updation failure",
"Error", JOptionPane.ERROR_MESSAGE);
}//inner try catch closed
}//if closed
if (e.getActionCommand().equalsIgnoreCase("Cancel")) {
this.dispose();
}//if closed
}
36
add(btnMark);
btnMark.addActionListener(this);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:student");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select RollNo from student");
cmbregno.removeAllItems();
while (rs.next()) {
cmbregno.addItem(rs.getString(1));
}
} catch (Exception ee) {
}
}
37
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "Error on Loading report", "Error",
JOptionPane.ERROR_MESSAGE);
}
}
}
38
10.OUTPUT
Fig : 1
Fig : 2
Fig : 3
39
Fig : 4
Fig : 5
40
Fig : 6
Fig : 7
41
Fig : 8
Fig : 9
42
Fig : 10
Fig : 11
Fig: 12
43
11.CONCLUSION
Our project is only a humble venture to satisfy the needs in an Institution. Several user
friendly coding have also adopted. This package shall prove to be a powerful package in
satisfying all the requirements of the organization. The objective of software planning is to
provide a frame work that enables the manger to make reasonable estimates made within a
limited time frame at the beginning of the software project and should be updated regularly
as the project progresses.
12.REFERENCE
➢ http://www.javaworld.com/javaworld/jw-01-1998/jw-01-bookreview.html
➢ Database Programming with JDBC and Java by O'Reilly
➢ Head First Java 2nd Edition
➢ http://www.jdbc-tutorial.com/
➢ Java and Software Design Concepts by APress
44