0% found this document useful (0 votes)
3 views

School Control Operating System

The project report titled 'School Control Operation System Using Java Programming' outlines the development of a software application aimed at enhancing school administration through automation of processes such as student and teacher registration. The system utilizes Java and MySQL for data management, ensuring data security and user-friendly access for authorized personnel. The report includes details on project scope, software requirements, and a breakdown of functionalities, aiming to improve efficiency and reduce manual errors in school operations.

Uploaded by

mirzarahul162
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

School Control Operating System

The project report titled 'School Control Operation System Using Java Programming' outlines the development of a software application aimed at enhancing school administration through automation of processes such as student and teacher registration. The system utilizes Java and MySQL for data management, ensuring data security and user-friendly access for authorized personnel. The report includes details on project scope, software requirements, and a breakdown of functionalities, aiming to improve efficiency and reduce manual errors in school operations.

Uploaded by

mirzarahul162
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 45

SCHOOL CONTROL OPERATION SYSTEM USING JAVA

PROGRAMMING

A Project Report for Industrial Training and Internship

submitted by

RAHUL MIRZA

In the partial fulfillment of the award of the degree of

B.TECH

in the

ELECTRONICS AND COMMUNICATION ENGINEERING


of
Kalyani Government Engineering College

at
Ardent Computech Pvt. Ltd.
CERTIFICATE FROM SUPERVISOR

This is to certify that RAHUL MIRZA, have completed the project titled "School Control
Operation System Using Java Programming" under my supervision during the period from
“02.08.2024” to “14.11.24” which is in partial fulfillment of requirements for the award of the
B.TECH degree and submitted to the Department of “Electronics and Communication
Engineering ” of “Kalyani Government Engineering College”.

___________________________
Signature of the Supervisor

Date: dd/mm/yy

Name of the Project Supervisor:


BONAFIDE CERTIFICATE

Certified that this project work was carried out under my supervision

“SCHOOL CONTROL OPERATING SYSTEM USING JAVA PROGRAMING” is the


bonafide work of

Name of the student: RAHUL MIRZA Signature

SIGNATURE

Name:

PROJECT MENTOR

SIGNATURE

Name: Mr Aninda Mukharjee

EXAMINERS

Ardent Original Seal


ACKNOWLEDGEMENT

The achievement associated with the successful completion of any task would be completed by
mentioning the names of those whose endless cooperation made it possible. Their constant
guidance and encouragement made all our efforts successful.

We take this opportunity to express our deep gratitude towards our project mentor, Mr Aninda
Mukharjee for giving such valuable suggestions, guidance, and encouragement during the
development of this project work.

Last but not least we are grateful to all Ardent Computech Pvt. Ltd. faculty members for their
support.
ABSTRACT OF THE PROJECT :-
The "School Control Operating System Using Java Programming" project aims to
streamline and enhance the administrative and academic management of a school environment
through a comprehensive software application. Developed using Java, this system automates key
school processes, including student registration, teacher registration etc. By centralizing these
functions, the system reduces manual tasks and minimizes the likelihood of human error, making
school operations more efficient and accessible.
This project also focuses on data security and accessibility, enabling authorized users,
such as teachers and administrators, to access and manage student information and records
quickly and securely. The Java-based platform leverages database integration to store, retrieve,
and update data seamlessly, ensuring real-time synchronization across modules. Additionally, the
system incorporates user-friendly interfaces and responsive layouts, allowing users to navigate
easily between different sections, perform tasks, and generate reports with minimal technical
expertise.
Ultimately, the "School Control Operating System Using Java Programming" addresses
common challenges faced in school administration, such as manual paperwork, limited
transparency, and data redundancy. By offering an all-in-one solution, this system enhances
communication, improves workflow efficiency, and provides accurate and timely insights into
school performance and student progress.
CONTENTS
1 Introduction

2 Scope of the Project

3 Software Requirement Specification

4 Entity relationship diagram

5 Data flow diagram

6 Coding Standard Followed & Screenshots

7 Implementation & Testing

8 Future scope and further enhancements

9 Conclusion

10 References and Bibliography


Introduction to School Control Operation System using Java :-

The School Control Operation System (SCOS) is a simple yet powerful software system
designed to manage and maintain records for students and teachers in an educational institution.
In this project, we will develop a Java-based application that interacts with a relational database
(like MySQL) to store and retrieve information regarding students and teachers. The system will
provide basic functionalities such as adding, updating, deleting, and viewing student and teacher
details.
The primary objective of this project is to:
1. Manage Student and Teacher Data: The system will allow for the efficient storage and
retrieval of information related to students and teachers. This includes personal details
such as name, age, grade (for students), subject (for teachers), and contact information
(address).
2. Interact with a Database: The project will use a database management system (DBMS)
like MySQL to persist data. JDBC (Java Database Connectivity) will be used to establish
a connection between the Java application and the MySQL database.
3. Create and Update Records: The system will allow users (typically administrators or
school staff) to add new records to the system (like registering new students or teachers).
Additionally, existing records can be updated to reflect changes.
4. Delete and View Records: The system will allow users to remove records (such as
deleting student or teacher data) and view or list the details of existing students and
teachers. This ensures easy access and maintenance of information.
Scope of the Project :-
The School Control Operation System (SCOS) is designed to manage essential data for
students and teachers in an educational institution. The scope of this project includes the
creation, storage, and management of student and teacher records in a MySQL database using
Java. The system allows for basic CRUD (Create, Read, Update, Delete) operations, enabling
administrators to add, modify, view, and delete student and teacher records, including details like
name, age, grade (for students), and subject (for teachers).
The project leverages JDBC (Java Database Connectivity) to interact with the MySQL
database, ensuring seamless data storage and retrieval. A simple console-based user interface
(UI) will allow users to interact with the system. This UI will support adding new records,
viewing existing ones, and updating or deleting data.
While the initial scope is focused on basic data management, the system is designed to be
extensible. Future enhancements may include advanced features such as search functionality,
reporting, role-based access control, and a more user-friendly Graphical User Interface (GUI).
The system also provides an opportunity to expand into other areas of school management, such
as class schedules, attendance, or financial tracking.
Overall, SCOS streamlines school administration by effectively organizing and managing
student and teacher data.
Software Requirement Specification :-

Software Requirements Specifications provides an overview of the entire project. It is a


description of a software system to be developed, laying out functional and non-functional
requirements. The software requirements specifications document enlists enough and necessary
requirements that are required for the project development. To derive the requirements we need
to have clear and through understanding of the project to be developed. This is prepared after the
detailed communication with the project team and the customer.

HARDWARE REQUIREMENTS:-

 Computer that has 1.5Ghz or faster processor

 4GB or above RAM required

 HDD 50GB(or above) or SSD space 50GB(or above)

SOFTWARE REQUIREMENTS:-

 Windows OS(7,8 or above)

 MySQL Server(8.0 or above)

 JDK 17.0.8
Entity relationship diagram:-

The Entity-Relationship Diagram (ERD) is a visual representation of the system's data model
and describes the relationships between different entities (tables) in the database. Below is an
ERD that represents the entities for managing students and teachers in the School Control
Operation System (SCOS).

Entities:

1. Student: This entity represents students in the school. It contains attributes like student
ID, name, age, grade, and address.
2. Teacher: This entity represents teachers. It contains attributes such as teacher ID, name,
subject taught, age, and address.

Relationships:

 One-to-Many Relationship: A teacher can teach multiple students (but each student has
one primary teacher, depending on school structure), which can be represented as a one-
to-many relationship between Teacher and Student.

This means each teacher can have many students associated with them, but each student
is assigned to one teacher. This can be further expanded to represent a more detailed
relationship, such as teacher-student classes or subjects.

Roll Id

Student Studies School Teaches


in
Teacher
in

Name Class
Name Subject

Relationship (One-to-Many):

 A teacher can have multiple students, but each student is assigned to only one teacher.
This is represented by a one-to-many relationship between the Teacher and Student
entities.
Data flow diagram :-
A Data Flow Diagram (DFD) provides a visual representation of how data flows within a
system and how it is processed by various components. It shows the flow of data between
external entities, processes, data stores, and data flows. Below is the DFD for the School
Control Operation System (SCOS), which handles student and teacher data management.

Level 0: Context Diagram

The Level 0 DFD, also known as the Context Diagram, provides an overview of the system and
its interactions with external entities. At this level, the entire system is treated as a single process,
with data flows representing interactions with external entities (e.g., Admin, Database).

Level 0 DFD (Context Diagram)

Student’s Teacher’s
Registration/Login School Control Registration/Login
Operation System Teacher
Student
0.0
Response to Student’s Response to Teacher’s
Registration/login Registration/login

Level 1: Decomposition of the SCOS System

The Level 1 DFD breaks down the main system process into smaller, more detailed sub-
processes. It shows the interaction between the sub-processes and how they communicate with
external entities and data stores.
Level 1 DFD:

Coding Standard Followed & Screenshots :-


1. School Dashboard
School Dashboard.java:
package school;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class School_Dashboard {

public static void main(String[] args) {


// Creating the main dashboard frame
JFrame frame = new JFrame("School Dashboard");

// Create a custom JPanel for the background image


JPanel panel = new JPanel() {
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);

// Load and draw the background image


ImageIcon backgroundImage = new ImageIcon("C:\\
Users\\DELL\\Desktop\\java\\School_Control\\School.jpg"); //
Path to our background image
g.drawImage(backgroundImage.getImage(), 0, 0,
getWidth(), getHeight(), this); // Stretch the image to fit the
panel
}
};

// Set the layout manager for the panel (null layout for
absolute positioning)
panel.setLayout(null);
frame.setContentPane(panel); // Set the panel as the
content pane of the frame

// Create buttons for Student and Teacher


JButton b1 = new JButton("Student");
JButton b2 = new JButton("Teacher");

// Set button bounds on the panel (position and size)


b1.setBounds(120, 50, 120, 50);
b2.setBounds(120, 120, 120, 50);
// Adding buttons to the panel
panel.add(b1);
panel.add(b2);

// Setting up the frame properties


frame.setSize(400, 400);
frame.setLayout(null); // No layout manager
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

// ActionListener for the Student button


b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// Open the Student interface (ensure Student
class has a main method)
Student.main(new String[]{});
// Optionally dispose of the dashboard window
after opening Student window
//frame.dispose();
}
});

// ActionListener for the Teacher button


b2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// Open the Teacher interface (ensure Teacher
class has a main method)
Teacher.main(new String[]{});
// Optionally dispose of the dashboard window
after opening Teacher window
//frame.dispose();
}
});
}
}

2. Student
Student.java:
package school;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Student {

public static void main(String[] args) {


// Create the student dashboard frame
JFrame frame = new JFrame("Student Dashboard");

// Create a custom JPanel for the background image


JPanel panel = new JPanel() {
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);

// Load and draw the background image


ImageIcon backgroundImage = new ImageIcon("C:\\
Users\\DELL\\Desktop\\java\\School_Control\\student.jpeg"); //
Update with the correct image path
g.drawImage(backgroundImage.getImage(), 0, 0,
getWidth(), getHeight(), this); // Stretch the image to fit the
panel
}
};

// Set layout manager for the panel (null layout for


absolute positioning)
panel.setLayout(null);
frame.setContentPane(panel); // Set the custom panel as
the content pane of the frame

// Create buttons for Insert, View, Update, and Delete


JButton b1 = new JButton("Insert");
JButton b2 = new JButton("View");
JButton b3 = new JButton("Update");
JButton b4 = new JButton("Delete");

// Set the position and size of each button


b1.setBounds(120, 50, 120, 50);
b2.setBounds(120, 120, 120, 50);
b3.setBounds(120, 190, 120, 50);
b4.setBounds(120, 260, 120, 50);

// Add buttons to the panel


panel.add(b1);
panel.add(b2);
panel.add(b3);
panel.add(b4);

// Set frame properties


frame.setSize(400, 400);
frame.setLayout(null); // No layout manager
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Ensure program exits when window is closed

// Action listener for the Insert button


b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// Open the Insert_Student window
Insert_Student.main(new String[]{});
// Close the current Student_Dashboard window
//frame.dispose();
}
});

// Action listener for the View (Search) button


b2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// Open the Search_Student window
Search_Student.main(new String[]{});
// Close the current Student_Dashboard window
//frame.dispose();
}
});

// Action listener for the Update button


b3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// Open the Update_Student window

UpdateSearch_Student.main(new String[] {});


// Close the current Student_Dashboard window
//frame.dispose();
}
});

// Action listener for the Delete button


b4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// Open the Delete_Student window
Delete_Student.main(new String[]{});
// Close the current Student_Dashboard window
//frame.dispose();
}
});
}
}

3. Insert Student
Insert_Student.java:
package school;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
public class Insert_Student {

public static void main(String[] args) {


// TODO Auto-generated method stub
JTextField tf1,tf2,tf3;
JButton b1;
JFrame f= new JFrame("Insert Student Details");
JLabel l1,l2,l3;
l1=new JLabel("Enter Roll");
l1.setBounds(10,10, 100,30);
tf1=new JTextField();
tf1.setBounds(40,40,150,20);
l2=new JLabel("Enter Name");
l2.setBounds(10,80, 100,30);
tf2=new JTextField();
tf2.setBounds(40,110,150,20);
l3=new JLabel("Enter Class");
l3.setBounds(10,150,100,30);
tf3=new JTextField();
tf3.setBounds(40,180,150,20);

b1=new JButton("SAVE");
b1.setBounds(50,400,100,50);
f.add(tf1);f.add(tf2);f.add(tf3);f.add(b1);
f.add(l1); f.add(l2); f.add(l3);
f.setSize(300,560);
f.setLayout(null);
f.setVisible(true);

b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int roll=Integer.parseInt(tf1.getText());
String name=tf2.getText();
int std=Integer.parseInt(tf3.getText());
Connection
con=Connection_Provider.createCon();
try {
PreparedStatement
pstm=con.prepareStatement("insert into student values(?,?,?)");
pstm.setInt(1, roll);
pstm.setString(2, name);
pstm.setInt(3, std);
pstm.executeUpdate();
JOptionPane.showMessageDialog(f,"Record
Updated Sucessfully!");
con.close();
}catch(Exception e1) {}
}
});

4. View Student
Search_Student.java:
package school;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

public class Search_Student {


public static void main(String[] args) {
JFrame f = new JFrame();

// Prompt user for Roll


String input = JOptionPane.showInputDialog(f, "Enter
Roll:");

// Check if the input is null (user pressed cancel)


if (input == null) {
JOptionPane.showMessageDialog(f, "No Roll entered.
Exiting.");
return; // Exit the program
}
try {
// Parse the Roll to an integer
int roll = Integer.parseInt(input);

// Call the method to view student with this Roll


View_Student.main(new String[]
{String.valueOf(roll)});
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(f, "Invalid Roll.
Please enter a numeric value.");
}
}
}

View_Student.java:
package school;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class View_Student {

public static void main(String[] args) {


// TODO Auto-generated method stub
int roll=Integer.parseInt(args[0]);
String name=null;
int std=0;

Connection con=Connection_Provider.createCon();
try {
PreparedStatement pstm=con.prepareStatement("select
*from student where roll=?");
pstm.setInt(1, roll);
ResultSet rs=pstm.executeQuery();
//System.out.println(rs);
while(rs.next())
{
name=rs.getString(2);
std=rs.getInt(3);
}
System.out.println(name);
}catch(Exception e) {}
JFrame f= new JFrame("View Record");
JLabel l1,l2,l3,l4,l5,l6;
l1=new JLabel("Roll Is:");
l1.setBounds(10,10, 100,30);
l2=new JLabel();
l2.setText(String.valueOf(roll));
l2.setBounds(90,10,150,20);
l3=new JLabel("Name Is:");
l3.setBounds(10,80, 100,30);
l4=new JLabel();
l4.setText(name);
l4.setBounds(90,80,150,20);
l5=new JLabel("Class is:");
l5.setBounds(10,160,100,30);
l6=new JLabel();
l6.setText(String.valueOf(std));
l6.setBounds(90,160,150,20);

f.add(l1);f.add(l2);f.add(l3);f.add(l4);
f.add(l5); f.add(l6);
f.setSize(300,400);
f.setLayout(null);
f.setVisible(true);

5. Update Student
UpdateSearch_Student.java:
package school;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class UpdateSearch_Student {
static String str;
public static void main(String[] args) {
JFrame f=new JFrame();
str=JOptionPane.showInputDialog(f,"Enter roll to
Update:");
Update_Student.main(new String[]{});
}

Update_Student.java:
package school;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

public class Update_Student {


static String name = null;
static int std = 0;

public static void main(String[] args) {


String roll = UpdateSearch_Student.str;

// Get a connection to the database


Connection con = Connection_Provider.createCon();

try {
// Prepare and execute a query to fetch existing
student data
PreparedStatement pstm =
con.prepareStatement("select * from student where roll = ?");
pstm.setString(1, roll);
ResultSet rs = pstm.executeQuery();

// Fetch the student's name and class from the


result set
while (rs.next()) {
name = rs.getString(2);
std = rs.getInt(3);
}

} catch (Exception e) {
// Handle database connection and query execution
exceptions
JOptionPane.showMessageDialog(null, "Error
retrieving student data: " + e.getMessage());
return;
}

// Create the GUI components


JFrame f = new JFrame("Update Record");
JTextField tf1, tf2, tf3;
JLabel l1, l3, l5;
JButton b1;

// Labels and text fields for displaying and editing


student info
l1 = new JLabel("Roll is:");
l1.setBounds(10, 10, 100, 30);
tf1 = new JTextField();
tf1.setText(roll); // Display roll number
tf1.setEditable(false); // Roll number is not editable
tf1.setBounds(90, 10, 150, 20);

l3 = new JLabel("Name is:");


l3.setBounds(10, 80, 100, 30);
tf2 = new JTextField();
tf2.setText(name); // Display current name
tf2.setBounds(90, 80, 150, 20);

l5 = new JLabel("Class is:");


l5.setBounds(10, 160, 100, 30);
tf3 = new JTextField();
tf3.setText(String.valueOf(std)); // Display current
class
tf3.setBounds(90, 160, 150, 20);

b1 = new JButton("Update");
b1.setBounds(90, 270, 150, 40);

// Add components to the frame


f.add(l1);
f.add(tf1);
f.add(l3);
f.add(tf2);
f.add(l5);
f.add(tf3);
f.add(b1);

// Frame settings
f.setSize(300, 400);
f.setLayout(null);
f.setVisible(true);
// Action listener for the "Update" button
b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// Get the values entered by the user
name = tf2.getText();
String classStr = tf3.getText();

// Validate input
if (name.isEmpty()) {
JOptionPane.showMessageDialog(f, "Name
cannot be empty!");
return;
}

try {
// Try to parse the class field to ensure
it's an integer
std = Integer.parseInt(classStr);
} catch (NumberFormatException ex) {
JOptionPane.showMessageDialog(f, "Please
enter a valid class number.");
return;
}

// Prepare and execute the update query


try {
PreparedStatement pstm =
con.prepareStatement("update student set name = ?, std = ? where
roll = ?");
pstm.setString(1, name);
pstm.setInt(2, std);
pstm.setString(3, roll);

int i = pstm.executeUpdate();

// If update is successful, show a success


message
if (i > 0) {
JOptionPane.showMessageDialog(f, "Record
updated successfully!");
} else {
JOptionPane.showMessageDialog(f, "Failed
to update the record.");
}

} catch (Exception e1) {


// Handle exceptions for the database update
JOptionPane.showMessageDialog(f, "Error
updating record: " + e1.getMessage());
}
}
});
}
}

6. Delete Student

Delete_Student.java:
package school;
import java.sql.Connection;
import java.sql.PreparedStatement;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class Delete_Student {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f=new JFrame();
String roll=JOptionPane.showInputDialog(f,"Enter
Roll:");
Connection con=Connection_Provider.createCon();
try {
PreparedStatement pstm=con.prepareStatement("delete
from student where roll=?");
pstm.setString(1, roll);
pstm.executeUpdate();
JOptionPane.showMessageDialog(f,"Record Deleted
Sucessfully!");
}catch(Exception e) {}
}

7. Teacher

Teacher.java:
Teacher.java:
package school;
import javax.swing.*;

import java.awt.Graphics;
import java.awt.event.*;
public class Teacher {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame frame=new JFrame("Teacher_DashBoard");
// Create a custom JPanel for the background image
JPanel panel = new JPanel() {
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);

// Load and draw the background image


ImageIcon backgroundImage = new ImageIcon("C:\\
Users\\DELL\\Desktop\\java\\School_Control\\teacher.jpeg"); //
Update with the correct image path
g.drawImage(backgroundImage.getImage(), 0, 0,
getWidth(), getHeight(), this); // Stretch the image to fit the
panel
}
};

// Set layout manager for the panel (null layout for


absolute positioning)
panel.setLayout(null);
frame.setContentPane(panel); // Set the custom panel as
the content pane of the frame

JButton b1=new JButton("Insert");


JButton b2=new JButton("View");
JButton b3=new JButton("Update");
JButton b4=new JButton("Delete");
b1.setBounds(80, 50, 120, 50);
b2.setBounds(80, 120, 120, 50);
b3.setBounds(80, 190, 120, 50);
b4.setBounds(80, 260, 120, 50);
frame.add(b1);
frame.add(b2);
frame.add(b3);
frame.add(b4);
frame.setSize(400, 400);
frame.setLayout(null);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Insert_Teacher.main(new String[]{});
//frame.dispose();
}
});
b2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Search_Teacher.main(new String[]{});
//frame.dispose();
}
});
b3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// Open the Update_Student window

UpdateSearch_Teacher.main(new String[] {});


// frame.dispose();
}
});

b4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Delete_Teacher.main(new String[]{});
//frame.dispose();
}
});
}

8. Insert Teacher
Insert_Teacher.java:
package school;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
public class Insert_Teacher {

public static void main(String[] args) {


// TODO Auto-generated method stub
JTextField tf1,tf2,tf3;
JButton b1;
JFrame f= new JFrame("Insert Teacher Details");
JLabel l1,l2,l3;
l1=new JLabel("Enter Id");
l1.setBounds(10,10, 100,30);
tf1=new JTextField();
tf1.setBounds(40,40,150,20);
l2=new JLabel("Enter Name");
l2.setBounds(10,80, 100,30);
tf2=new JTextField();
tf2.setBounds(40,110,150,20);
l3=new JLabel("Enter Subject");
l3.setBounds(10,150,100,30);
tf3=new JTextField();
tf3.setBounds(40,180,150,20);

b1=new JButton("SAVE");
b1.setBounds(50,400,100,50);
f.add(tf1);f.add(tf2);f.add(tf3);f.add(b1);
f.add(l1); f.add(l2); f.add(l3);
f.setSize(300,560);
f.setLayout(null);
f.setVisible(true);

b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int id=Integer.parseInt(tf1.getText());
String name=tf2.getText();
String subject=tf3.getText();
Connection
con=Connection_Provider.createCon();
try {
PreparedStatement
pstm=con.prepareStatement("insert into teacher values(?,?,?)");
pstm.setInt(1, id);
pstm.setString(2, name);
pstm.setString(3, subject);
pstm.executeUpdate();
JOptionPane.showMessageDialog(f,"Record
Updated Sucessfully!");
con.close();
}catch(Exception e1) {}
}
});

}
9. View Teacher

Search_Teacher.java:
package school;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class Search_Teacher {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f = new JFrame();

// Prompt user for Roll


String input = JOptionPane.showInputDialog(f, "Enter
Id:");

// Check if the input is null (user pressed cancel)


if (input == null) {
JOptionPane.showMessageDialog(f, "No Id entered.
Exiting.");
return; // Exit the program
}

try {
// Parse the Roll to an integer
int id = Integer.parseInt(input);

// Call the method to view student with this Roll


View_Teacher.main(new String[]{String.valueOf(id)});
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(f, "Invalid Id. Please
enter a numeric value.");
}
}
}

View_Teacher.java:
package school;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class View_Teacher {

public static void main(String[] args) {


// TODO Auto-generated method stub
int id=Integer.parseInt(args[0]);
String name=null;
String subject=null;

Connection con=Connection_Provider.createCon();
try {
PreparedStatement pstm=con.prepareStatement("select
*from teacher where id=?");
pstm.setInt(1, id);
ResultSet rs=pstm.executeQuery();
//System.out.println(rs);
while(rs.next())
{
name=rs.getString(2);
subject=rs.getString(3);
}
System.out.println(name);
}catch(Exception e) {}
JFrame f= new JFrame("View Record");
JLabel l1,l2,l3,l4,l5,l6;
l1=new JLabel("Id Is:");
l1.setBounds(10,10, 100,30);
l2=new JLabel();
l2.setText(String.valueOf(id));
l2.setBounds(90,10,150,20);
l3=new JLabel("Name Is:");
l3.setBounds(10,80, 100,30);
l4=new JLabel();
l4.setText(name);
l4.setBounds(90,80,150,20);
l5=new JLabel("Subject:");
l5.setBounds(10,160,100,30);
l6=new JLabel();
l6.setText(subject);
l6.setBounds(90,160,150,20);

f.add(l1);f.add(l2);f.add(l3);f.add(l4);
f.add(l5); f.add(l6);
f.setSize(300,400);
f.setLayout(null);
f.setVisible(true);
}

10. Update Teacher


UpdateSearch_Teacher.java:
package school;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class UpdateSearch_Teacher {
static String str;
public static void main(String[] args) {
JFrame f=new JFrame();
str=JOptionPane.showInputDialog(f,"Enter id to
Update:");
Update_Teacher.main(new String[]{});
}

Update_Teacher.java:
package school;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

public class Update_Teacher {


static String name = null;
static String subject = null;

public static void main(String[] args) {


String id = UpdateSearch_Teacher.str; // Assuming id is
passed from a previous search

Connection con = Connection_Provider.createCon(); //


Get a connection to the database

try {
// Fetch the teacher's existing information using
the id
PreparedStatement pstm =
con.prepareStatement("select * from teacher where id = ?");
pstm.setString(1, id);
ResultSet rs = pstm.executeQuery();

// Store the teacher's data in the static variables


for use
while (rs.next()) {
name = rs.getString(2);
subject = rs.getString(3);
}
} catch (Exception e) {
// Handle any database errors
JOptionPane.showMessageDialog(null, "Error fetching
data: " + e.getMessage());
return; // Stop execution if data fetching fails
}

// Create the GUI components


JFrame f = new JFrame("Update Teacher Record");
JTextField tf1, tf2, tf3;
JLabel l1, l3, l5;
JButton b1;

// Create labels and text fields


l1 = new JLabel("Id Is:");
l1.setBounds(10, 10, 100, 30);
tf1 = new JTextField();
tf1.setText(id); // Display the teacher's ID (read-
only)
tf1.setEditable(false);
tf1.setBounds(90, 10, 150, 20);

l3 = new JLabel("Name Is:");


l3.setBounds(10, 80, 100, 30);
tf2 = new JTextField();
tf2.setText(name); // Display current name
tf2.setBounds(90, 80, 150, 20);

l5 = new JLabel("Subject Is:");


l5.setBounds(10, 160, 100, 30);
tf3 = new JTextField();
tf3.setText(subject); // Display current subject
tf3.setBounds(90, 160, 150, 20);

b1 = new JButton("Update");
b1.setBounds(90, 270, 150, 40);

// Add components to the frame


f.add(l1);
f.add(tf1);
f.add(l3);
f.add(tf2);
f.add(l5);
f.add(tf3);
f.add(b1);

// Set frame properties


f.setSize(300, 400);
f.setLayout(null);
f.setVisible(true);

// Action listener for the "Update" button


b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// Get the values from the text fields
name = tf2.getText();
subject = tf3.getText();

// Validate the inputs


if (name.isEmpty()) {
JOptionPane.showMessageDialog(f, "Name
cannot be empty!");
return;
}
if (subject.isEmpty()) {
JOptionPane.showMessageDialog(f, "Subject
cannot be empty!");
return;
}

// Update the teacher record in the database


try {
// Prepare the SQL update statement
PreparedStatement pstm =
con.prepareStatement("update teacher set name = ?, subject = ?
where id = ?");
pstm.setString(1, name);
pstm.setString(2, subject);
pstm.setString(3, id); // Set the ID
parameter correctly

// Execute the update query


int i = pstm.executeUpdate();

// Provide feedback to the user


if (i > 0) {
JOptionPane.showMessageDialog(f, "Record
updated successfully!");
} else {
JOptionPane.showMessageDialog(f, "Failed
to update the record.");
}
} catch (Exception e1) {
// Handle any errors during the update
process
JOptionPane.showMessageDialog(f, "Error
updating record: " + e1.getMessage());
}
}
});
}
}

11. Delete Teacher

Delete_Teacher.java:
package school;
import java.sql.Connection;
import java.sql.PreparedStatement;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class Delete_Teacher {

public static void main(String[] args) {


// TODO Auto-generated method stub
JFrame f=new JFrame();
String id=JOptionPane.showInputDialog(f,"Enter Id:");
Connection con=Connection_Provider.createCon();
try {
PreparedStatement pstm=con.prepareStatement("delete
from teacher where id=?");
pstm.setString(1, id);
pstm.executeUpdate();
JOptionPane.showMessageDialog(f,"Record Deleted
Sucessfully!");
}catch(Exception e) {}
}

}
12. Connection Provider

package school;
import java.sql.*;
public class Connection_Provider {

public static Connection con;


public static Connection createCon()
{
try {
Class.forName("com.mysql.cj.jdbc.Driver");

con=DriverManager.getConnection("jdbc:mysql://localhost:3306/Sch
ool","root","mirza@2024");
}catch(Exception e1) {}
return con;
}

}
Implementation & Testing :-
Implementation: The School Control Operation System (SCOS) is implemented using Java
for the backend logic and MySQL for data storage. The system uses JDBC (Java Database
Connectivity) to interact with the MySQL database, handling CRUD operations for student and
teacher records. The program allows administrators to add, view, update, and delete data from
the Student and Teacher tables.
The backend logic is organized into separate Java classes:

 Student Management Class: Handles all CRUD operations for students.


 Teacher Management Class: Manages teacher records.
 Database Connection Class: Facilitates communication between the Java application
and MySQL database.

A console-based interface is used to allow admins to perform actions by entering commands.


Each action triggers the relevant method in the corresponding class to interact with the database.

Testing: Testing is done in multiple phases:

1. Unit Testing: Individual methods in the CRUD classes are tested to ensure correct
functionality. For example, the method for adding students checks if records are correctly
inserted into the database.
2. Integration Testing: The interaction between Java classes and MySQL is tested by
performing end-to-end CRUD operations and verifying that the data is correctly stored
and retrieved from the database.
3. User Acceptance Testing (UAT): Admins test the system by performing typical
administrative tasks (adding, updating, deleting student and teacher records) to ensure the
system meets functional requirements and is easy to use.

Future scope and further enhancements :-

The future scope of the School Control Operation System (SCOS) includes expanding the
system to handle additional school management functions such as attendance tracking, grading
systems, and class scheduling. A Graphical User Interface (GUI) using JavaFX or Swing
could be implemented for a more user-friendly experience. Additionally, role-based access
control can be added to allow different levels of user access (e.g., admin, teacher, student).
Search functionality and report generation for student performance and teacher assignments
are also potential enhancements. Cloud integration could be explored for better data storage and
accessibility across devices.
Conclusion :-
In conclusion, the development of a "School Control Operation System" in Java provides an
efficient and scalable solution for managing various administrative tasks within educational
institutions. By automating processes such as student registration, attendance tracking, grade
management, and communication between teachers, students, and parents, the system can
significantly reduce administrative workload and improve operational efficiency. Java’s object-
oriented features, robustness, and cross-platform capabilities make it an ideal choice for building
a reliable and future-proof system that can scale with the needs of schools of all sizes.
As schools continue to embrace digital transformation, the potential for further
enhancements to the system is vast. Integrating advanced technologies like AI, cloud computing,
and advanced analytics can not only improve student outcomes but also streamline school
management processes. Ultimately, a well-designed School Control Operation System can
empower educators, students, and administrators, fostering a more efficient, connected, and
effective learning environment. The continued evolution of such systems will play a pivotal role
in shaping the future of education.
References :-

1. Java Programming and School Management Systems


o Liang, Y. D. (2017). Introduction to Java Programming and Data Structures.
Pearson Education.
o Deitel, P., & Deitel, H. (2015). Java How to Program: Late Objects Version.
Pearson.
o Schildt, H. (2018). Java: The Complete Reference, Eleventh Edition. McGraw-
Hill Education.
2. Database Integration for School Management
o Connolly, T., & Begg, C. (2015). Database Systems: A Practical Approach to
Design, Implementation, and Management. Pearson.
o Silberschatz, A., Korth, H. F., & Sudarshan, S. (2020). Database System
Concepts. McGraw-Hill Education.
o Elmasri, R., & Navathe, S. B. (2016). Fundamentals of Database Systems.
Pearson.
3. User Interface and Experience Design for Educational Systems
o Cooper, A., Reimann, R., & Cronin, D. (2014). About Face: The Essentials of
Interaction Design. John Wiley & Sons.
o Shneiderman, B., Plaisant, C., Cohen, M., Jacobs, S., & Elmqvist, N. (2016).
Designing the User Interface: Strategies for Effective Human-Computer
Interaction. Pearson.
4. System Security for School Management Applications
o Stallings, W. (2017). Network Security Essentials: Applications and Standards.
Pearson.
o Anderson, R. (2020). Security Engineering: A Guide to Building Dependable
Distributed Systems. Wiley.
o Kaufman, C., Perlman, R., & Speciner, M. (2016). Network Security: Private
Communication in a Public World. Pearson.
5. Software Development Methodologies
o Sommerville, I. (2015). Software Engineering. Pearson.
o Pressman, R. S., & Maxim, B. R. (2020). Software Engineering: A Practitioner's
Approach. McGraw-Hill Education.
Bibliography :-

 Malik, D. S. (2019). Java Programming: From Problem Analysis to Program Design.


Cengage Learning.
 Goodrich, M. T., Tamassia, R., & Goldwasser, M. H. (2014). Data Structures and
Algorithms in Java. Wiley.
 Boehm, B., & Turner, R. (2004). Balancing Agility and Discipline: A Guide for the
Perplexed. Addison-Wesley.
 Spinellis, D. (2014). Code Reading: The Open Source Perspective. Addison-Wesley.
 Fowler, M. (2018). Refactoring: Improving the Design of Existing Code. Addison-
Wesley Professional.
 Prabhu, S. (2018). "Development of School Management System Using Java and
MySQL." International Journal of Computer Applications, 180(40), 14-21.
This list includes books, journals, and articles that provide foundational knowledge for
developing a school management system using Java, covering areas from programming and
database integration to user interface design and system security.

You might also like