java correct project
java correct project
Course :JPR
Submitted by,
1
DEPARTMENT OF COMPUTER ENGINEERING
CERTIFICATE
This is to certify that the micro project report entitled
“Student Management System”
Submitted by,
Place: Ahmednagar
Date: / /2024.
2
ACKNOWLEDGEMENT
We take this opportunity to acknowledge the constant encouragement and continuous help
given to us by our guide Prof. Palwe P.D. We convey our sincere thanks to her valuable timely
suggestion. We would also like to thanks principal Prof. Gadakh R.S. and Head of Computer
Department Prof. Hole P.P. We would also like to thank teaching staff of Computer
Department for helping us to achieve this goal. We are also thankful to those who directly or
indirectly helped us for completing this micro project. We would like to thank our parents
without whose supports; the completion of the micro project would not have been possible.
3
INDEX
PART PLAN – A
PART PLAN - B
8.0 Output 17
12.0 Conclusion 21
4
PART PLAN – A
5
• Deployment & Enhancements – Convert to GUI, add features like grading,
authentication, and attendance tracking.
3. Textbook AJP 1
6
PART PLAN – B
James Gosling, Mike Sheridan, Patrick Naughton, Chris Warth and Ed Frank initiated the Java
language project in June 1991 at Sun Microsystems. Java was originally designed for
interactive television but it was far advanced for the digital cable television industry at the
time. The language was initially called Oak after an oak tree that stood outside Goslings office.
Later the project went by the name Green and was finally renamed to Java, from Java coffee.
Gosling designed java with a C/C++style syntax that system and application programmers
would find familiar.
Sun Microsystems released the first public implementation as Java 1.0 in 1995. It promised
“Write Once, Run Anywhere” (WORA), providing no-cost run –times on popular platforms.
Fairly secure and featuring configurable security, it allowed network-and file-access
restrictions.
7
inheriting common attributes like and . Interfaces provide a way to enforce consistency across
multiple implementations by defining methods that must be implemented by any class that
adopts them. In the project, the interface outlines database operations, ensuring different
database handlers conform to the same structure.
Packages help structure code by organizing related class es together, making large projects
more manageable and reducing naming conflicts. For instance, handles database operations,
defines student-related classes, and manages business logic.
These three principles—inheritance, interfaces, and packages—contribute to the efficiency,
modularity, and maintainability of Java-based applications, making the Student Management
System well-structured and scalable.
1. Object-Oriented – Java follows the OOP principles, enabling modular, reusable, and
scalable code.
2. Platform-Independent – Java’s Write Once, Run Anywhere (WORA) capability allows
execution on different OS using the JVM (Java Virtual Machine).
3. Robust & Secure – Java includes exception handling and memory management
features, preventing crashes and vulnerabilities.
4. Multithreading – Supports concurrent execution of multiple tasks, making
applications faster and more efficient.
5. Automatic Garbage Collection – The Java Garbage Collector automatically removes
unneeded objects, optimizing memory usage.
8
6. Rich API – Offers built-in libraries for networking, database connectivity, data
structures, and more.
7. High Performance – Though an interpreted language, Java uses JIT (Just-In-Time)
compilation to boost execution speed.
8. Distributed Computing Support – Facilitates network-based applications, including
web servers and cloud-based solutions.
9. Simple & Familiar – Java’s syntax is similar to C/C++, making it easier for developers to
learn.
package student;
import java.sql.*;
class Student { int id; String name; Student(int id, String name) { this.id = id; this.name
= name; }}
interface StudentDAO { void addStudent(Student student); }
class DatabaseHandler implements StudentDAO {
public void addStudent(Student student) {
try (Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/school", "root",
"password")) {
conn.prepareStatement("INSERT INTO students VALUES (" + student.id + ", '" +
student.name + "')").executeUpdate();
System.out.println("Student Added!");
} catch (SQLException e) { e.printStackTrace(); }
}
}
public class StudentManagement {
public static void main(String[] args) { new DatabaseHandler().addStudent(new
Student(1, "Alice")); }
}
9
7.0 Source Code
package studentApp;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
10
public GraduateStudent(int id, String name, String researchTopic) {
super(id, name);
this.researchTopic = researchTopic;
}
@Override
public void displayInfo() {
super.displayInfo();
System.out.println("Research Topic: " + researchTopic);
}
}
11
return null;
}
}
@Override
public void addStudent(Student student) {
try (Connection conn = connect()) {
String sql = "INSERT INTO students (id, name, research_topic) VALUES (?, ?, ?)";
PreparedStatement stmt = conn.prepareStatement(sql);
stmt.setInt(1, student.id);
stmt.setString(2, student.name);
stmt.setString(3, (student instanceof GraduateStudent) ? ((GraduateStudent)
student).researchTopic : null);
stmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Student Added!");
} catch (SQLException e) {
e.printStackTrace();
}
}
@Override
public void updateStudent(Student student) {
try (Connection conn = connect()) {
String sql = "UPDATE students SET name = ?, research_topic = ? WHERE id = ?";
PreparedStatement stmt = conn.prepareStatement(sql);
stmt.setString(1, student.name);
stmt.setString(2, (student instanceof GraduateStudent) ? ((GraduateStudent)
student).researchTopic : null);
stmt.setInt(3, student.id);
stmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Student Updated!");
12
} catch (SQLException e) {
e.printStackTrace();
}
}
@Override
public void deleteStudent(int id) {
try (Connection conn = connect()) {
String sql = "DELETE FROM students WHERE id = ?";
PreparedStatement stmt = conn.prepareStatement(sql);
stmt.setInt(1, id);
stmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Student Deleted!");
} catch (SQLException e) {
e.printStackTrace();
}
}
@Override
public Student getStudent(int id) {
try (Connection conn = connect()) {
String sql = "SELECT * FROM students WHERE id = ?";
PreparedStatement stmt = conn.prepareStatement(sql);
stmt.setInt(1, id);
ResultSet rs = stmt.executeQuery();
if (rs.next()) {
return new GraduateStudent(rs.getInt("id"), rs.getString("name"),
rs.getString("research_topic"));
} else {
13
JOptionPane.showMessageDialog(null, "Student Not Found!");
return null;
}
} catch (SQLException e) {
e.printStackTrace();
return null;
}
}
@Override
public List<Student> getAllStudents() {
List<Student> students = new ArrayList<>();
try (Connection conn = connect()) {
String sql = "SELECT * FROM students";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
students.add(new GraduateStudent(rs.getInt("id"), rs.getString("name"),
rs.getString("research_topic")));
}
} catch (SQLException e) {
e.printStackTrace();
}
return students;
}
}
// GUI Class
public class StudentManagementGUI extends JFrame {
14
JTextField idField, nameField, topicField;
JButton addBtn, viewBtn, updateBtn, deleteBtn;
JTextArea displayArea;
DatabaseHandler db = new DatabaseHandler();
public StudentManagementGUI() {
setTitle("Student Management System");
setSize(500, 400);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new GridLayout(6, 2));
add(new JLabel("ID:"));
idField = new JTextField(); add(idField);
add(new JLabel("Name:"));
nameField = new JTextField(); add(nameField);
15
viewBtn.addActionListener(e -> displayArea.setText(getStudentsInfo()));
deleteBtn.addActionListener(e ->
db.deleteStudent(Integer.parseInt(idField.getText())));
setVisible(true);
}
16
8.0 Output
1. Create a Database
17
6. show the Data
18
9.0 Advantages & Features
1. Advantages:
• Efficiency – Automates student data handling, reducing manual work.
• Scalability – Easily expandable to include more functionalities (attendance, grades,
etc.).
• Security – Uses JDBC with MySQL, ensuring secure database management.
• Structured Code – Organized with inheritance, interface, and packages, making
maintenance easier.
• Modularity – Separates concerns (GUI, database, business logic), improving
reusability.
• User-Friendly – Provides a graphical interface (GUI) for easy interaction.
• Real-Time Updates – Modifications in student records are instantly reflected in the
database.
2. Key Features:
1. Skill Development:
• Java Mastery – Enhances your Java skills with concepts like exception handling,
encapsulation, and abstraction.
• SQL & Database Handling – Teaches how to work with MySQL, making database
management easier.
19
• Problem Solving – Encourages logical thinking for designing efficient CRUD operations.
2. Practical Uses:
• Resume Enhancement – A great addition to your portfolio for job applications or
college projects.
• Expandable – You can add more functionalities like authentication, GUI, or reporting
features.
• Foundation for Larger Projects – Can be evolved into a full-fledged Student
Management System with additional modules.
3. Textbook AJP 1
12.0 Conclusion
• Java offers the real possibility that most programs can be written in a type safe
language. However, for Java to be broadly useful, it needs to have more expressive
power than it does at present.
• Java extends Java with a mechanism for parametric polymorphism, which allows the
definition and implementation of generic abstractions. The paper gives a complete
design for the extended language.
20
ANNEXURE II
Evaluation Sheet for the Micro Project
2b. Use relevant type of JDBC Driver for the specified environment. (c)Outcomes in Affective
Domain---------------------------------------------------------------------- --------------------------------------------------
---------------------------------Comments/Suggestion about team work/leadership/inter-personal
communication (if any)
---------------------------------------------------------------------- ---------------------------------------------------------------
------------------------------------------------------------------------------------------
Sr. Student Name Student Name Marks Marks out of 4 for Total out
No. out of 6 for performance in oral/ of 10
performance in group presentation (D5 Col.9)
activity (D5 Col. 8) 1
1. Narote Pallavi .B
2. Shaikh Saniya .F
3. More Renvi .B
21