Вы находитесь на странице: 1из 54

Training Report

on
Student Management System

Submitted in partial fulfilment of the requirements


For the award of the degree of

BACHELOR OF TECHNOLOGY
in
INFORMATION TECHNOLOGY

Submitted By
Manish Yadav
2815364
Batch (2015-2019)

Panipat Institute of Engineering & Technology,


(Affiliated to Kurukshetra University Kurukshetra, India)
Samalkha, Panipat
(Session e.g. 2017-2018)

1
CANDIDATES DECLARATION

I hereby declare that the work presented in this training report entitled Student
Management System, submitted in partial fullfillment of the requirement for the award
of the degree of Bachelor of Technology in Information Technology, submitted to
Panipat Institute of Engineering & Technology, Kurukshetra University,
Kurukshetra, India is an authentic record of my own work carried out during the period
from 15TH June 2017 to To 30th July 2017 under the guidance of Mr.Rattandeep
Aneja..

The work reported in this project report has not been submitted by me for the award of
any other degree or diploma.

Date:18-08-2017 ManishYadav

Place: PIET, Samalkha (Panipat) Roll No.2815364

i
CERTIFICATE

This is to certify that the summer training report (Code e.g. CSE-408) entitled Student
Management System done by Manish Yadav, Roll No. 2815364 is an authentic work
carried out by him at S.L.R Infotech under my guidance. The matter embodied in this
training title/ project work has not been submitted earlier for the award of any degree or
diploma to the best of my knowledge and belief.

Date:18-08-2017 Priyanka Gaba

Training Coordinator

ii
Acknowledgement

In the Acknowledgement page, the writer recognizes his indebtedness for guidance and
assistance of the director and F/I, project guide and other members of the
faculty/company. Courtesy demands that he also recognize specific contributions by
other persons or institutions such as libraries and research foundations.
Acknowledgements should be expressed simply, tastefully, and tactfully.

Manish Yadav
(Student Name)

iii
ABSTRACT
Introduction:
Today we are living the world where we surrounded by computers of daily and
personal as well as professional use. We know that a individual person or an
organization cannot survive without computers. From schools to big corporate houses
everyone needs computers. But only computers are not enough we need strong
softwares and large database to handle vast amount of data.

The main aim is to design something which is very basic, understandable to everyone
so that everyone can use easily and effectively because for making any project/product
our aim is to design product which is useful to our audience like corporate houses or the
common people. Today schools are developing at a very high rate with the increase in
number of students. So it becomes difficult to maintain their details like store, update
and retrive.
Body:
Student management contains various modules which are used for storing various
profiles with their respective data. That is the aim.Now the questions arrives how?
The process becomes simple and easy when you store data and retrive it in simple
steps.
In the very first part you need to select what you wish to do like login or register for the
first time you need to register yourself for saving your data.

After doing this you can go for login where after providing correct details which you
have provided in the previous step i.e registration you can login to access student
database which contains complete information about students .now second thing is it
sufficient?

The answer is no because sometimes you need to update you data like marks or mobile
So it becomes necessary to providing interface for users to access or update and a
special interface for deleting data of existing users. Then it looks great because you

iv
have most of the required inputs from the user that is our school staff.

Scope and limitations:


It is useful where less effort and more performance required.
One time investment as you have to pay only for first time not like paper
and pan.
It is useful where large no of students as well as small group of students.
Time one person multiple tasks like register, update and delete in no
time with little manpower.
Useful for both govt and private schools.

Conclusion:

CONTENTS (16 PTS.)


Candidate's Declaration i

Certificate ii

Acknowledgement iii

Abstract iv

List of Figures vi

List of Tables vii

Chapter No Description Page No.

Chapter 1: INTRODUCTION 1

1.1 Objective 1

1.2 New student registration 4

1.3 Login 6

1.4 View, Update, Delete Students 8

v
List of Figures

Figure No Figure Name Page no.

Figure 7.1 Welcome screen 42

Figure 7.2 Selection screen 43

Figure 7.3 Register screen 44

Figure 7.4 Login,View,update,delete 45

vi
List of Tables

Table No Table Name Page no

Table 1.1 Software Requirements 05

Table 2.1 Hardware Requirements 06


Table 2.2 Login 08

1
LIST OF ABBREVIATIONS USED

Abbrevations are listed below:


JDBC Java database connectivity
JRE Java runtime environment
JVM Java virtual machine
JDK Java development kit

2
CHAPTER-1
INTRODUCTION
1.1 Objective:
The main objective of the project if to make use softwares in such a manner that staff can
maintain various records of students such as their name, class, roll no,
D.O.B, contact details and their marks.

Now the need is firstly save the record using user interface which can take the input from
staff in form of application form where he/she may enter the data corresponding to their
fields after successful submission of data which is stored in database using JDBC drivers.

After this successful submission of data he/she needs to access the stored data.
Which can only be accessed if the password and roll no matches to database records
which are provided during the time of form submission. If both things match i.e they are
successfully logged to database now they are able to access data.

Which is in the form of view update or delete?


So by this user can perform his duties.

1.2 New Student Registration:

This is the very first part/module where user is provided the user interface which id
designed using java windows programming (Swing and AWT) .This interface provides
predefined fields which are adjoined with fields which are able to take input from the
user and store it into the database which is done by using JDBC tools and drivers.

This section requires database which is MYSQL in our case. Where our data is stored and
the whole process is controlled by SQL. After successful submission he gets automated
message data successfully submitted which shows data saved without any failure.

1.3 Login Student:

3
After successful submission record submission he can login inorder to access his/her
student data if the password and roll matches to records provided by teacher. This part is
the very important part of database because it ensures safety of data access.

Only authorised users can access this data otherwise it can be in wrong hands and whole
database may in trouble. It includes various steps to get data from the database and the
user and mechanism which is responsible for checking both data very strictly.

1.4 View, Update, Delete Students:

View Student Data:


Here our aim is to get data which is used for preparing results after exams which were
stored in the first step it means retrival of data from the database. But we know that in
database data is stored in the form of tables where as we provided our input in the
application format so that viewing of data should be in the application format which
makes easier to be accessed by the user which again requires front end programming
swing/awt to show the desired result in specified format.

Update Student data:


In this case if a student has changed its address, mobile or his marks got updated we need
to update them in the database at the place of making separate database because we
cannot create multiple databases which are of low use it is just wastage of our resources
and time. It requires complex part i.e search mechanism which is used to find student
whose data is required to be updated and then selected student data is updated.

Deleting Student:
In some of the cases if student is promoted or his studies complete his studies now his
data is required to get deleted. This mechanism again requires searching of that particular
student and then deleting his data by his roll no and finally data of student is deleted with
the confirmation message to ensure it not a mistake.

4
CHAPTER-2
SOFTWARE AND HARDWARE REQUIREMENTS
This project requires software and hardware which is easily available in the market. Most
of the resources came from open source which makes it more interesting and innovative
where with investing little money you can earn more.
Mostly java projects require system with better performance to meet the needs of
softwares like normal ram with good computation power.

2.1 Software Requirements:

The minimum software requirements for java are described in the following table.

1 Operating System Windows 7 or higher/Linux/Mac

2 Environment JRE

3 Front-end Tool JAVA(Swing and awt)

4 Technology JAVA

5 Versioning Tools 8.0.

6 Backend My SQL Server , Xamp server

7 Connectivity JDBC

Table 2.1

Hardware Requirements:
The minimum hardware requirement for java project are described in the following table
5
1. Processor Pentium 2 266 MHz processor.

2. Motherboard Intel 845

3. RAM 128 MB

4. Hard Disk 20 GB minimum.

5. Architecture 32/64 bit

6. I/O Devices Monitor LCD/LED, Keyboard, Mouse

7. Disk space 124 MB for JRE

Abbreviations
Table 2.2

6
CHAPTER-3
SOFTWARE REQUIREMENT ANALYSIS
3.1 DEFINE THE PROBLEM:
Our problem is to store the data of 100s or 1000s of student record without wasting time
and using simple UI and also perform various operation of deletion updation and
searching.

3.2 DEFINE THE MODULES AND THEIR FUNCTIONALITIES:

MODULE 1:
In this module user data is saved to the database using database connectivity. This
module ensures that user data is properly saved to the appropriate fields of table login.

MODULE 2:
In this module user is allowed to enter his login details to access his/her record. This
required database connectivity. After providing correct login details he can login to
access data.

MODULE 3:
In this module database is again connected to provide view data entered by the user to
the database this makes sure that he/she can keep check of records in the database.

MODULE 4:
In the module database connectivity is used to update user data to the database using
mechanism for searching respective data and also updating it.

MODULE 5:
In this module database is finally connected to delete the records provided by user. This
modules check that data provided to delete must be found in the database.

7
CHAPTER-4
SOFTWARE DESIGN
RDBMS
In this project we used rdbms that is relational database model.

8
CHAPTER-5
CODING
class signup

Connection con;

protected PreparedStatement pst;

void start()

try

Class.forName("com.mysql.jdbc.Driver");

System.out.println("Driver Connected you can Register or


Login");

con=DriverManager.getConnection("jdbc:mysql://localhost:3306/login","ro
ot","");

catch(SQLException e)

e.printStackTrace();

catch(ClassNotFoundException e)

e.printStackTrace();

JFrame frame = new JFrame("Welcome");

frame.setLayout(null);

frame.setSize(1400,800);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

9
try

frame.setIconImage(ImageIO.read(new
File("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Frame.png")));

catch (IOException exc)

exc.printStackTrace();

// Top panel 1(Header)

JPanel toppanel = new JPanel();

toppanel.setLayout(null);

toppanel.setBackground(Color.BLUE);

toppanel.setBounds(0,0,1400,60);

frame.add(toppanel);

// Botton Panel

JPanel bottompanel = new JPanel();

bottompanel.setLayout(null);

bottompanel.setBackground(Color.WHITE);

bottompanel.setBounds(0,60,1400,800);

frame.add(bottompanel);

JLabel title = new JLabel("Brahmanand Public School Sector-


8 Karnal");

title.setBounds(300,3,800, 60);

title.setFont(new Font("comicSans",Font.BOLD,35));

toppanel.add(title);

// Background

try

10
BufferedImage myPicture = ImageIO.read(new
File("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Background(Registe
r).jpg"));

JLabel picLabel = new JLabel(new ImageIcon(myPicture));

picLabel.setBounds(0,0, 1400, 700);

bottompanel.add(picLabel);

catch (IOException exc)

ImageIcon start= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Start)
.png");

JButton startButton = new JButton(start);

startButton.setBounds(600, 300, 141, 62);

bottompanel.add(startButton);

startButton.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent arg0)

welcome();

});

frame.setVisible(true);

// Register frame

void welcome()

try

11
Class.forName("com.mysql.jdbc.Driver");

System.out.println("Driver Connected you can Register or


Login");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/login","ro
ot",""); }

catch(SQLException e)

e.printStackTrace();

catch(ClassNotFoundException e)

e.printStackTrace();

JFrame frame = new JFrame("Welcome");

frame.setLayout(null);

frame.setSize(1400,800);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

// Icon setting

try

frame.setIconImage(ImageIO.read(new
File("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Frame.png")));

catch (IOException exc)

exc.printStackTrace();

// Top panel 1(Header)

JPanel toppanel = new JPanel();

toppanel.setLayout(null);

12
toppanel.setBackground(Color.BLUE);

toppanel.setBounds(0,0,1400,60);

frame.add(toppanel);

// Bottom Panel

JPanel bottompanel = new JPanel();

bottompanel.setLayout(null);

bottompanel.setBackground(Color.WHITE);

bottompanel.setBounds(0,60,1400,800);

frame.add(bottompanel);

JLabel title = new JLabel("Brahmanand Public School Sector-


8 Karnal");

title.setBounds(300,3,800, 60);

title.setFont(new Font("comicSans",Font.BOLD,35));

toppanel.add(title);

try

BufferedImage myPicture = ImageIO.read(new


File("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Logo(Welcome).png"
));

JLabel picLabel = new JLabel(new ImageIcon(myPicture));

picLabel.setOpaque(true);

picLabel.setBounds(520, 100, 250, 250);

bottompanel.add(picLabel);

catch (IOException exc)

ImageIcon register= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Regist
er).png");

13
JButton registerButton = new JButton(register);

registerButton.setBounds(400, 500, 209, 49);

bottompanel.add(registerButton);

registerButton.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent arg0)

frame();

});

ImageIcon login= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Login)
.png");

JButton signinButton = new JButton(login);

signinButton.setBounds(700, 500, 209, 49);

bottompanel.add(signinButton);

signinButton.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent arg0)

login();

});

frame.setVisible(true);

// Registration Frame or Window

void frame()

JFrame frame = new JFrame("Welcome");

14
frame.setLayout(null);

frame.setSize(1400,800);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

try

frame.setIconImage(ImageIO.read(new
File("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Frame.png")));

catch (IOException exc)

exc.printStackTrace();

JPanel toppanel = new JPanel();

toppanel.setLayout(null);

toppanel.setBackground(Color.BLUE);

toppanel.setBounds(0,0,1400,60);

frame.add(toppanel);

JPanel panel = new JPanel();

panel.setLayout(null);

panel.setBackground(Color.WHITE);

panel.setBounds(0,60,1400,700);

frame.add(panel);

JLabel title = new JLabel("Brahmanand Public School Sector-


8 Karnal");

title.setBounds(300,3,800, 60);

title.setFont(new Font("comicSans",Font.BOLD,35));

toppanel.add(title);

JLabel nameLabel2 = new JLabel("Registration Form");

nameLabel2.setBounds(500,20, 400,40);

15
nameLabel2.setFont(new
Font("comicSans",Font.BOLD,35));

panel.add(nameLabel2);

JLabel IDLabel = new JLabel("Roll no");

IDLabel.setFont(new Font("comicSans",Font.BOLD,20));

IDLabel.setBounds(250, 110, 150, 30);

panel.add(IDLabel);

JLabel classLabel = new JLabel("Class");

classLabel.setBounds(550, 110, 150, 30);

classLabel.setFont(new
Font("comicSans",Font.BOLD,20));

panel.add(classLabel);

String
Class[]={"Select","Ist","IInd","IIIrd","IVth","Vth","VIth","VIIth","VII
Ith","IXth","Xth","XIth","XIIth"};

JTextField nameText = new JTextField(20); // name

nameText.setBounds(350, 200, 150, 30);

panel.add(nameText);

JLabel dobLabel= new JLabel("D.O.B");

dobLabel.setFont(new Font("comicSans",Font.BOLD,20));

dobLabel.setBounds(550, 200, 150, 30);

panel.add(dobLabel);

JLabel fnameLabel = new JLabel("Father");

fnameLabel.setFont(new
Font("comicSans",Font.BOLD,20));

fnameLabel.setBounds(250, 290, 150, 30);

panel.add(fnameLabel);

JTextField fnameText = new JTextField(20);

fnameText.setBounds(350, 290, 150, 30);

panel.add(fnameText);

16
mnameLabel.setBounds(550, 290, 150, 30);

panel.add(mnameLabel);

JTextField mnameText = new JTextField(20);

mnameText.setBounds(650, 290, 150, 30);

panel.add(mnameText);

JLabel emailLabel = new JLabel("E-mail");

emailLabel.setBounds(250, 380, 150, 30);

emailLabel.setFont(newFont("comicSans",Font.BOLD,20));

panel.add(emailLabel);

JTextField emailText = new JTextField(20); // name

emailText.setBounds(350, 380, 150, 30);

panel.add(emailText);

JLabel mobileLabel = new JLabel("Mobile");

mobileLabel.setBounds(550, 380, 150, 30);

mobileLabel.setFont(new
Font("comicSans",Font.BOLD,20));

panel.add(mobileLabel);

JTextField mobileText = new JTextField(20); //name

mobileText.setBounds(650, 380, 150, 30);

panel.add(mobileText);

JLabel passwordLabel = new JLabel("Password");

passwordLabel.setFont(newFont("comicSans",Font.BOLD,20));

passwordLabel.setBounds(250,470, 150, 30);

panel.add(passwordLabel);

JPasswordField passwordText = new JPasswordField(10);

passwordText.setBounds(350, 470, 150, 30);

panel.add(passwordText);

JLabel genderLabel = new JLabel("Gender");

genderLabel.setFont(newFont("comicSans",Font.BOLD,20));

17
genderLabel.setBounds(550, 470, 150, 30);

panel.add(genderLabel);

JRadioButton maleButton = new JRadioButton("Male");

maleButton.setFont(newFont("comicSans",Font.BOLD,15));

maleButton.setBounds(650,470,70,35);

JRadioButton femaleButton = new


JRadioButton("Female");

femaleButton.setFont(new
Font("comicSans",Font.BOLD,15));

femaleButton.setBounds(720,470,70,35);

ButtonGroup group = new ButtonGroup();

group.add(maleButton);

group.add(femaleButton);

panel.add(maleButton);

panel.add(femaleButton);

maleButton.setSelected(true);

JLabel marksLabel = new JLabel("Marks");

marksLabel.setFont(newFont("comicSans",Font.BOLD,20));

marksLabel.setBounds(1000,50, 150, 30);

panel.add(marksLabel);

JLabel sub1Label = new JLabel("SUB 1");

sub1Label.setFont(new
Font("comicSans",Font.BOLD,20));

sub1Label.setBounds(900,110, 70, 30);

panel.add(sub1Label);

JTextField sub1Text = new JTextField(10);

sub1Text.setBounds(1000, 110, 70, 30);

panel.add(sub1Text);

JLabel sub2Label = new JLabel("SUB 2");

18
sub2Label.setFont(newFont("comicSans",Font.BOLD,20));

sub2Label.setBounds(900, 200, 70, 30);

panel.add(sub2Label);

JTextField sub2Text = new JTextField(10);

sub2Text.setBounds(1000, 200, 70, 30);

panel.add(sub2Text);

JLabel sub3Label = new;

sub3Label.setBounds(900,290, 70, 30);

panel.add(sub3Label);

JLabel sub4Label = new JLabel("SUB 4");

sub4Label.setFont(newFont("comicSans",Font.BOLD,20));

sub4Label.setBounds(900,380, 70, 30);

panel.add(sub4Label);

JTextField sub4Text = new JTextField(10);

sub4Text.setBounds(1000, 380, 70, 30);

panel.add(sub4Text);

JLabel sub5Label = new JLabel("SUB 5");

sub5Label.setFont(new
Font("comicSans",Font.BOLD,20));

sub5Label.setBounds(900,470, 70, 30);

panel.add(sub5Label);

JTextField sub5Text = new JTextField(10);

sub5Text.setBounds(1000, 470, 70, 30);

panel.add(sub5Text);

er(new ActionListener()

public void actionPerformed(ActionEvent arg0)

welcome();

19
});

JButton signupButton = new JButton(save);

signupButton.setBounds(600, 550, 113, 44);

panel.add(signupButton);

signupButton.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent arg0)

String ID=IDText.getText();

String Name=nameText.getText();

String fName=fnameText.getText();

String mName=mnameText.getText();

String dob=dobText.getText();

String Class =
comboBox1.getSelectedItem().toString();

String email=emailText.getText();

String mobile=mobileText.getText();

String password=passwordText.getText();

String sub1=sub1Text.getText();

String sub2=sub1Text.getText();

String sub3=sub1Text.getText();

String sub4=sub1Text.getText();

String sub5=sub1Text.getText();

String gender="";

if(maleButton.isSelected())

gender=maleButton.getText().trim();

20
else if(femaleButton.isSelected())

gender=femaleButton.getText().toString();

try

String insert="insert into


login(ID,NAME,FNAME,MNAME,DOB,CLASS,GENDER,EMAIL,MOBILE,PASSWORD,SUB1,S
UB2,SUB3,SUB4,SUB5) values
('"+ID+"','"+Name+"','"+fName+"','"+mName+"','"+dob+"','"+Class+"','"+g
ender+"','"+email+"','"+mobile+"','"+password+"','"+sub1+"','"+sub2+"',
'"+sub3+"','"+sub4+"','"+sub5+"')";

Statement st=con.createStatement();

int a=st.executeUpdate(insert);

if(a==0)

JOptionPane.showMessageDialog(panel,"Failed to Save,Duplicate
roll no found");

else

JOptionPane.showMessageDialog(null,"Data
Successfully Saved");

catch(SQLException e)

e.printStackTrace();

});

21
JButton registerButton = new JButton(login);
registerButton.setBounds(740, 550, 113, 44);

panel.add(registerButton);

registerButton.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent arg0)

login();

});

frame.setVisible(true);

// Log In Frame or window

void login()

try

Class.forName("com.mysql.jdbc.Driver");

System.out.println("Driver Connected : Login");

con=DriverManager.getConnection("jdbc:mysql://localhost:3306/login","ro
ot","");

JFrame frame = new JFrame("Log In");

frame.setLayout(null);

frame.setSize(1400,800);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

try

22
BufferedImage logo = ImageIO.read(new
File("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Logo(Login).png"))
;

JLabel picLabel = new JLabel(new ImageIcon(logo));

picLabel.setBounds(530, 15, 245, 245);

panel.add(picLabel);

catch (IOException exc)

// exc.printStackTrace();

JLabel testLabel = new JLabel("Enter Student Data");

testLabel.setBounds(500, 260, 400, 43);

testLabel.setFont(new
Font("comicSans",Font.BOLD,35));

panel.add(testLabel);

JLabel nameLabel1 = new JLabel("Roll No");

nameLabel1.setBounds(450, 350, 150, 30);

nameLabel1.setFont(new
Font("comicSans",Font.BOLD,25));

panel.add(nameLabel1);

JTextField nameText1 = new JTextField(20); // name

nameText1.setBounds(650, 350, 200, 30);

panel.add(nameText1);

JLabel pwdLabel = new JLabel("Password");

pwdLabel.setBounds(450, 430, 150, 30);

pwdLabel.setFont(new Font("comicSans",Font.BOLD,25));

panel.add(pwdLabel);

JPasswordField passwordText = new JPasswordField(10);

passwordText.setBounds(650, 430, 200, 30);

23
panel.add(passwordText);

ImageIcon Return= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Return
).png");

JButton backButton = new JButton(Return);

backButton.setBounds(450, 510, 111, 35);

panel.add(backButton);

backButton.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent arg0)

welcome();

});

ImageIcon Login= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Log_in
).png");

JButton signinButton = new JButton(Login);

signinButton.setBounds(590, 510, 111, 37);

panel.add(signinButton);

signinButton.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent arg0)

String name=nameText1.getText();

String pass=passwordText.getText();

try

pst=con.prepareStatement("Select *
From login where ID ='"+name+"'");

24
ResultSet rs=pst.executeQuery();

if(rs.next()){if(name.equals(rs.getString(1)) &&
pass.equals(rs.getString(8))){

JOptionPane.showMessageDialog(null,"User Authorised");

signin();}

else{

JOptionPane.showMessageDialog(null,"Incorrect Password");}}

else{

JOptionPane.showMessageDialog(null, "User not found ");}}

catch (SQLException e){

e.printStackTrace();

}}});

ImageIcon Reset= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Reset)
.png");

JButton resetButton = new JButton(Reset);

resetButton.setBounds(740, 510, 111, 37);

panel.add(resetButton);

resetButton.addActionListener(new ActionListener()

{ public void actionPerformed(ActionEvent arg0) {

nameText1.setText("");

passwordText.setText("");

});

frame.setVisible(true);

// Accessing Database Menu

void signin()

{ try {

25
Class.forName("com.mysql.jdbc.Driver");

System.out.println("Driver Connected : Accessing Database


Menu");

con=DriverManager.getConnection("jdbc:mysql://localhost:3306/login","ro
ot","");

catch(SQLException e)

e.printStackTrace();

catch(ClassNotFoundException e)

e.printStackTrace();

JFrame frame = new JFrame("Menu");

frame.setLayout(null);

frame.setSize(1400,800);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

try

frame.setIconImage(ImageIO.read(new
File("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Frame.png"))); }

catch (IOException exc)

{ exc.printStackTrace();}

JPanel toppanel = new JPanel();

toppanel.setLayout(null);

toppanel.setBackground(Color.BLUE);

toppanel.setBounds(0,0,1400,70);

26
frame.add(toppanel);

JLabel title = new JLabel("Brahmanand PublicSchoolKarnal");

JButton accountButton = new JButton(View);

accountButton.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent arg0)

JOptionPane.showMessageDialog(null,"ViewSelected");

view();

} });

ImageIcon Update= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Update
).png");

JButton updateButton = new JButton(Update);

updateButton.setBounds(800, 330, 134, 78);

middlepanel.add(updateButton);

updateButton.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent arg0) {

JOptionPane.showMessageDialog(null,"Update selected");

update();}

});

ImageIcon Delete= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Delete
).png");

JButton deleteButton = new JButton(Delete);

deleteButton.setBounds(560, 530, 134, 78);

middlepanel.add(deleteButton);

deleteButton.addActionListener(new ActionListener()

27
public void actionPerformed(ActionEvent arg0)

JOptionPane.showMessageDialog(null,"Delete selected");

delete();

}});

ImageIcon Exit= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Exit).
png");

JButton ExitButton = new JButton(Exit);

ExitButton.setBounds(320, 330, 134, 78);

middlepanel.add(ExitButton);

ExitButton.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent e)

System.exit(1);

} });

ImageIcon Logout= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Logout
).png");

JButton LogoutButton = new JButton(Logout);

LogoutButton.setBounds(1200, 30, 103, 41);

middlepanel.add(LogoutButton);

LogoutButton.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent arg0){

JOptionPane.showMessageDialog(null,"Logout selected");

login();

} });

28
frame.setVisible(true);

// update frame

void update()

{ try

Class.forName("com.mysql.jdbc.Driver");

System.out.println("Driver Connected updating data");


con=DriverManager.getConnection("jdbc:mysql://localhost:3306/login","ro
ot","");}

catch(SQLException e){

e.printStackTrace(); }

catch(ClassNotFoundException e)

{ e.printStackTrace(); }

JFrame frame = new JFrame("Updating Data");

frame.setLayout(null);

frame.setBounds(370,0,600,800);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setVisible(true);

try {

frame.setIconImage(ImageIO.read(new
File("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Frame.png")));
}

catch (IOException exc)

{ exc.printStackTrace(); }

JPanel toppanel = new JPanel();

toppanel.setLayout(null);

toppanel.setBackground(Color.BLUE);

29
toppanel.setBounds(0,0,600,70);

frame.add(toppanel);

JLabel title = new JLabel("Brahmanand PublicSchoolKarnal");

title.setBounds(100,5,500, 40);

title.setFont(new Font("comicSans",Font.BOLD,25));

toppanel.add(title);

JPanel panel = new JPanel();

panel.setLayout(null);

panel.setBackground(Color.WHITE);

panel.setBounds(0,70,600,800);

frame.add(panel);

catch(SQLException e)

e.printStackTrace();

catch(ClassNotFoundException e)

e.printStackTrace();

JFrame frame = new JFrame("View Data");

frame.setLayout(null);

frame.setBounds(370,0,600,800);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setVisible(true);

try

30
frame.setIconImage(ImageIO.read(new
File("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Frame.png")));

catch (IOException exc)

exc.printStackTrace();

JPanel toppanel = new JPanel();

toppanel.setLayout(null);

toppanel.setBackground(Color.BLUE);

toppanel.setBounds(0,0,600,70);

frame.add(toppanel);

JLabel title = new JLabel("Brahmanand Public School


Karnal");

title.setBounds(100,5,500, 40);

title.setFont(new Font("comicSans",Font.BOLD,25));

toppanel.add(title);

JPanel panel = new JPanel();

panel.setLayout(null);

panel.setBackground(Color.WHITE);

panel.setBounds(0,70,600,800);

frame.add(panel);

panel.add(FMOBILELabel);

JTextField FMOBILEText = new JTextField(20); //


name

FMOBILEText.setBounds(190,450, 100, 30);

panel.add(FMOBILEText);

JLabel FEMAILLabel = new JLabel("EMAIL");

31
FEMAILLabel.setBounds(150, 500, 100, 30);

FEMAILLabel.setFont(new
Font("comicSans",Font.BOLD,15));

panel.add(FEMAILLabel);

JTextField FEMAILText = new JTextField(20); //


name

FEMAILText.setBounds(250, 500, 150, 30);

panel.add(FEMAILText);

JLabel FPASSWORDLabel = new JLabel("Password");

FPASSWORDLabel.setFont(new
Font("comicSans",Font.BOLD,15));

FPASSWORDLabel.setBounds(320,150, 100, 30);

panel.add(FPASSWORDLabel);

JTextField FPASSWORDText = new JTextField(10);

FPASSWORDText.setBounds(420, 150, 100, 30);

panel.add(FPASSWORDText);

JLabel FSUB1Label = new JLabel("SUB 1");

FSUB1Label.setFont(new
Font("comicSans",Font.BOLD,15));

FSUB1Label.setBounds(320,200, 100, 20);

panel.add(FSUB1Label);

JTextField FSUB1Text = new JTextField(10);

FSUB1Text.setBounds(420,200, 100, 30);

panel.add(FSUB1Text);

JLabel FSUB2Label = new JLabel("SUB 2");

FSUB2Label.setFont(new
Font("comicSans",Font.BOLD,15));

FSUB2Label.setBounds(320,250, 100, 30);

panel.add(FSUB2Label);

JLabel FGENDERLabel = new JLabel("Gender");

32
FGENDERLabel.setFont(new
Font("comicSans",Font.BOLD,15));

FGENDERLabel.setBounds(320, 450, 100, 30);

panel.add(FGENDERLabel);

JTextField FGENDERText = new JTextField(10);

FGENDERText.setBounds(420,450, 100, 30);

panel.add(FGENDERText);

JLabel searchLabel = new JLabel("Enter ID");

searchLabel.setFont(newFont("comicSans",Font.BOLD,20));

searchLabel.setBounds(200, 30, 200, 30);

panel.add(searchLabel);

JTextField searchText = new JTextField(20); //name

searchText.setBounds(350, 30, 60, 30);

panel.add(searchText);

ImageIcon Exit= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Exit1)
.png"); JButton ExitButton = new JButton(Exit);

ExitButton.setFont(new
Font("comicSans",Font.BOLD,15));

ExitButton.setBounds(250, 550, 98, 43);

panel.add(ExitButton);

ExitButton.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent e)

System.exit(1);

});

ImageIcon Search= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Search
).png");

33
JButton searchButton = new JButton(Search);

searchButton.setBounds(250, 80, 101, 41);

searchButton.setFont(new Font("comicSans",Font.BOLD,15));

panel.add(searchButton);

searchButton.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent arg0)


{

String search=searchText.getText();

try {

String select="select
ID,NAME,FNAME,MNAME,DOB,CLASS,MOBILE,PASSWORD,EMAIL,GENDER,SUB1,SUB2,SU
B3,SUB4,SUB5 from login where ID='"+search+"'";

Statement st=con.createStatement();

ResultSet rs=st.executeQuery(select);

if(rs!=null)

if(rs.next())

String ID=rs.getString(1);

String NAME=rs.getString(2);

String FNAME=rs.getString(3);

String MNAME=rs.getString(4);

String DOB=rs.getString(5);

String CLASS=rs.getString(6);

StringMOBILE=rs.getString(7);

StringPASSWORD=rs.getString(8);

String EMAIL=rs.getString(9);

StringGENDER=rs.getString(10);

String SUB1=rs.getString(11);

34
String SUB2=rs.getString(12);

String SUB3=rs.getString(13);

String SUB4=rs.getString(14);

String SUB5=rs.getString(15);

FIDText.setText(ID.toString());

FNAMEText.setText(NAME.toString());
FFNAMEText.setText(FNAME.toString());

FMNAMEText.setText(MNAME.toString());

FDOBText.setText(DOB.toString());

FCLASSText.setText(CLASS.toString());

FMOBILEText.setText(MOBILE.toString());

FPASSWORDText.setText(PASSWORD.toString());

FEMAILText.setText(EMAIL.toString());

FGENDERText.setText(GENDER.toString());

FSUB1Text.setText(SUB1.toString());

FSUB2Text.setText(SUB2.toString());

FSUB3Text.setText(SUB3.toString());

FSUB4Text.setText(SUB4.toString());

FSUB5Text.setText(SUB5.toString());

else{

35
JOptionPane.showMessageDialog(null,"No Data");

} }

catch (SQLException e)

JOptionPane.showMessageDialog(null,"NoData");

}}});

frame.setVisible(true);

// Delete frame

void delete(){

try{

Class.forName("com.mysql.jdbc.Driver");

System.out.println("Driver Connected for


deletion");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/logi
n","root",""); }

catch(SQLException e)

e.printStackTrace();

catch(ClassNotFoundException e)

e.printStackTrace();

JFrame frame = new JFrame("Delete Data");

frame.setLayout(null);

frame.setBounds(370,97,600,600);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

36
frame.setVisible(true);

try

frame.setIconImage(ImageIO.read(new
File("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Frame.png")));

catch (IOException exc)

{exc.printStackTrace();

JPanel toppanel = new JPanel();

toppanel.setLayout(null);

toppanel.setBackground(Color.BLUE);

toppanel.setBounds(0,0,600,50);

frame.add(toppanel);

JLabel title = new JLabel("Brahmanand PublicSchoolKarnal");

title.setBounds(100,5,500, 40);

title.setFont(new Font("comicSans",Font.BOLD,25));

toppanel.add(title);

JPanel panel = new JPanel();

panel.setLayout(null);

panel.setBackground(Color.WHITE);

panel.setBounds(0,50,600,750);

frame.add(panel);

JLabel DeleteLabel = new JLabel("Delete Your Data");

DeleteLabel.setFont(new Font("comicSans",Font.BOLD,30));

DeleteLabel.setBounds(200, 100, 400, 35);

panel.add(DeleteLabel);

JLabel FIDLabel = new JLabel("Enter ID");

FIDLabel.setFont(new Font("comicSans",Font.BOLD,30));

37
FIDLabel.setBounds(250, 180, 300,35 );

panel.add(FIDLabel);

JTextField FIDText = new JTextField(20); // name

FIDText.setBounds(250, 260, 100, 30);

panel.add(FIDText);

try {

BufferedImage logo = ImageIO.read(new


File("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Logo(Delete).jpg")
);

JLabel picLabel = new JLabel(new ImageIcon(logo));

picLabel.setBounds(150, 60, 300, 300);

panel.add(picLabel);}

catch (IOException exc){

// exc.printStackTrace();

ImageIcon delete= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Delete
1).png");

JButton searchButton = new JButton(delete);

searchButton.setBounds(180, 350, 105, 43);

panel.add(searchButton);

searchButton.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent arg0)

String FID=FIDText.getText();

try

pst = con.prepareStatement("DELETE
FROM login WHERE ID = '"+FID+"'");

38
pst.executeUpdate();

JOptionPane.showConfirmDialog(null,
"Confirm Delete");

JOptionPane.showMessageDialog(null,"Data Successfully Deleted");

catch(Exception e)

JOptionPane.showMessageDialog(null,"No Data");

} }});

ImageIcon Return= new


ImageIcon("C:\\Users\\manish\\Desktop\\STUDENT\\icon+jar\\Button(Return
1).png");

JButton returnButton = new JButton(Return);

returnButton.setBounds(320, 350, 105, 43);

panel.add(returnButton);

returnButton.addActionListener(new ActionListener()

public void actionPerformed(ActionEvent e) {

signin();} });

frame.setVisible(true);}

//MAIN METHOD

public static void main(String[] args)

//main method

signup aa=new signup(); //MAIN CLASS

aa.start(); //WELCOME FRAME

39
40
CHAPTER-6
Testing
Process of testing involves various checks knows as test so that project performance is
measured in terms of various parameters.

For testing any software we need to apply various steps for each level known as cases.

Case-1:

User provides his input in the form of registration details. Test checks that whether login
details are previously entered or not in case or wrong details it returns wrong input

Case-2:

In this case of login window user provides roll no and password to access student login
details if details are correct then a message is displayed authorised to access data

Case-3:
In this case if user provides a roll no to his details then he /she can access that data
randomly.

41
CHAPTER-7
OUTPUT:

Figure no: 7.1

Figure no: 7.2

42
Figure no :7.3

Figure no 7.4

43
Figure no: 7.5(Select operation)

Figure no: 7.6(View data)

44
Figure no:7.7(Update Data)

Figure no: 7.8(Delete data)

45
CHAPTER-8
CONCLUSION
Each and every project has its own pros and cons where as student database management
offers wide variety of advantages to school management to use like less paper work, easy
to update or delete new or old students to database without wasting too much time.

But depending too much upon software may become a big headache for the school staff
Like database is connected due to JDBC drivers .That me lead to wastage of our time and
money so it becomes important to know how your software works because knowledge is
the key to success without this you cannot be successful in any field.

46
1

Вам также может понравиться