0% found this document useful (0 votes)
35 views26 pages

Event Scheduling System

EVENT SCHEDULING BY JAVA WITH SQL

Uploaded by

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

Event Scheduling System

EVENT SCHEDULING BY JAVA WITH SQL

Uploaded by

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

ABSTRACT

The Event Management System is designed to simplify the process of managing


events by providing a user-friendly interface for creating, viewing, updating, and
deleting event details. This system aims to reduce the administrative burden
associated with event management, especially for organizations that host multiple
events. It allows users to input event-specific information, including the event's
name, date, time, location, and payment mode, and stores this data in a secure
database. Using Java and JDBC, the system ensures that the data is efficiently
processed and stored, offering robust support for various event management
tasks.The system provides four core functionalities: creating events, which
involves entering basic details like event name and date; viewing events,
allowing users to retrieve and display event information from the database;
updating events, enabling users to modify existing events; and deleting events,
removing unnecessary or outdated events. Additionally, a command-line
interface guides users through the different options, ensuring ease of use. The
program incorporates secure practices such as parameterized queries to prevent
SQL injection attacks and guarantees the integrity of user inputs through proper
validation.By adopting a modular approach, the system is designed to be
extendable, allowing for the integration of additional features in the future, such
as attendee registration or payment processing. The architecture of the system
ensures scalability, making it suitable for small gatherings as well as larger
conferences. This Event Management System, while simple, provides a
foundation for further developments, making it a reliable and adaptable solution
for event organizers across various domains.

viii
TABLE OF CONTENTS
CHAPTER NO. TITLE PAGE NO.

ABSTRACT

1 INTRODUCTION

1.1 Objective 1

1.2 Overview 2

1.3 Java Programming concepts 3

2 PROJECT METHODOLOGY

2.1 Proposed Work 5

2.2 Block Diagram 6

3 MODULE DESCRIPTION

3.1 Create Event 7

3.2 View event 7

3.3 Update event 8

3.4 Delete Event 8

3.5 Exit event 9

4 CONCLUSION & FUTURE SCOPE

4.1 Conclusion 10

4.2 Future Scope 11

REFERENCES 24

APPENDIX A (SOURCE CODE) 13

APPENDIX B (SCREENSHOTS) 21

x
CHAPTER 1
INTRODUCTION

12.1 Objective

The primary objective of this program is to streamline event management by


providing a simple and user-friendly command-line interface for interacting with
a relational database. It enables users to efficiently organize and maintain event
schedules by performing essential CRUD (Create, Read, Update, Delete)
operations. Users can create events by entering details such as name, date, start
and end times, location, description, WhatsApp link, organizing college, and
payment mode, all of which are stored in the database.

The program allows users to view all stored events, retrieve specific event details,
update event records based on their unique IDs, and delete events as needed.
Database connectivity is established using JDBC, ensuring smooth interaction
with the underlying Events table. To enhance reliability, the program validates
inputs for critical fields, such as restricting payment mode options to "Online" or
"Offline." It employs a menu-driven interface that guides users through each
operation step-by-step, providing clear instructions and feedback.

By focusing on simplicity and accuracy, the program helps small organizations,


communities, or institutions to effectively schedule and manage events.
Additionally, it serves as an educational tool for understanding the integration of
Java and databases, offering a practical demonstration of real-world CRUD
operations.

1
.

12.2 Overview

This project is an Event Management System designed to facilitate the


organization and handling of event details through a command-line interface. It
connects to a relational database using JDBC and performs CRUD (Create, Read,
Update, Delete) operations on an `Events` table. Users can create new events by
providing relevant details such as event name, date, time, location, description,
organizing college, and payment mode. The system ensures input validation, such as
allowing only "Online" or "Offline" payment modes, to maintain data accuracy.

The program also enables users to view all stored events in the database, update
existing event records by specifying an event ID, and delete events as needed. A
menu-driven interface ensures user-friendliness, guiding users through the
operations with clear instructions and feedback. Each operation involves
executing SQL queries, ensuring robust interaction with the database.

Designed to streamline event scheduling and management, this project is ideal for
small organizations, academic institutions, or communities. It also serves as a
practical learning tool for developers and students to understand database
connectivity, SQL integration, and Java-based application development.

2
12.3 Java Programming Concepts

The program demonstrates several key Java concepts that are essential for
building real-world applications. Below is an overview of the Java concepts
applied in this program:
1. Object-Oriented Programming (OOP):
 The program uses classes (EventManagement) and methods (e.g.,
createEvent, readEvents, updateEvent, deleteEvent) to organize
functionality logically and modularly.
2. JDBC (Java Database Connectivity):
 JDBC is used to connect to a relational database and perform CRUD
operations through SQL queries. Key JDBC classes include
Connection, PreparedStatement, Statement, and ResultSet.
3. Exception Handling:
 The program uses try-catch blocks to handle SQLException,
ensuring graceful handling of database-related errors and providing
meaningful error messages.
4. Input Handling:
 The Scanner class is used to read user input from the command line,
allowing interaction with the user for event details and menu
navigation.
5. Control Flow:
 The program employs switch statements and while loops to manage
the flow of the application, including menu navigation and repetitive
input prompts.
6. Validation:
 Input validation ensures that critical fields like Payment Mode

3
accept only specific values ("Online" or "Offline"). Loops and
conditional statements enforce these rules.
7. SQL Query Execution:
 SQL commands (INSERT, SELECT, UPDATE, DELETE) are
executed dynamically using PreparedStatement and Statement
objects, demonstrating how Java integrates with databases.
8. Modular Design:
 Each CRUD operation is encapsulated within its own method,
promoting code reusability and separation of concerns.
9. Dynamic Querying:
 The program uses placeholders (?) in PreparedStatement to
dynamically insert user inputs into SQL queries, preventing SQL
injection attacks.
10. Data Types:
 Java's data types are mapped to SQL types (e.g., String for text
fields, int for IDs), demonstrating type compatibility between Java
and relational databases.
11. Loops and Iterations:
 The program uses loops for tasks like displaying multiple events
from a ResultSet and repeatedly showing the menu until the user
exits.
12. System Integration:
 The program showcases how Java applications can integrate with
external systems (databases) to manage and process real-world data.
These concepts make the program a comprehensive example of building
practical, database-driven applications in Java.

4
CHAPTER 2
PROJECT METHODOLOGY

2.1 Proposed Work

The proposed work involves creating a comprehensive Event Management


System that simplifies the entire event organization process. The system will be built
using Java and JDBC to interact with a relational database, allowingfor
efficient storage and retrieval of event details. Initially, the program will
focus on core functionalities, such as creating events, registering attendees,
and displaying participant lists.

In the first phase, the program will allow event creation by specifying key
details like the event name, date, and location. After the event is created,
users will have the option to register attendees for the event. The system will
prompt for attendee information, ensuring smooth and systematic
registration. It will allow users to add multiple attendees and keep track of
who has registered. The process will continue until there are no more
attendees to register.

Once registration is complete, the system will display a list of all registered
attendees, providing an overview of the event's participation. The flow of
this process will be guided by a user-friendly, step-by-step interface, and an
interactive menu will allow users to navigate the operations with ease.

In the subsequent phases, the project could be expanded to include advanced


features like event search and filtering, managing multiple events, and
sending automated notifications to attendees. Security enhancements such as
user authentication for event creation and registration may also be added.
Additionally, the user interface could be upgraded from a command-line
interface (CLI) to a graphical user interface (GUI) for better user experience.

5
Ultimately, this project aims to provide a scalable solution for small to
medium-sized event management, enabling organizations to streamline the
event organization process while maintaining an organized database for
event and attendee details.

2.2 Block Diagram

Fig 2.1

6
CHAPTER 3
MODULE DESCRIPTION

The Event Management System consists of five modules: Create Event, View
Event, Update Event, Delete Event, and Exit Event. These modules have been
designed to handle various aspects of the event management process, ensuring
smooth operations from event creation to its removal. Each module serves a
specific function: the Create Event module allows users to add new events, the
View Event module enables users to view all the events, the Update Event module
allows for modifications to existing events, and the Delete Event module
facilitates the removal of events that are no longer needed. Finally, the Exit Event
module ensures a proper termination of the system. All these modules work
together cohesively, allowing users to efficiently manage event data throughout
its lifecycle.

3.1 CREATE EVENT

This module allows users to create a new event by providing necessary details,
such as event name, date, start time, end time, description, location, WhatsApp
link, organizing college, and payment mode. Once the user enters the required
information, the event is stored in the database using an SQL INSERT query.
This module ensures that the event details are successfully captured and stored
for future use.

3.2 VIEW EVENT

The view event module retrieves and displays all events stored in the database.
The program executes an SQL SELECT query to fetch all the event records, and
then it iterates over each record to display the event details to the user. This
module provides an overview of all events, showing information such as event

7
name, date, time, description, location, and more, allowing users to review the
event.

3.3 UPDATE EVENT

In this module, users can update the details of an existing event by


specifying its unique Event ID. The program prompts the user to enter the
new details (e.g., name, date, time, location) for the event, and an SQL
UPDATE query is executed to modify the event record in the database. This
allows for flexibility in managing events, enabling users to make changes as
needed, such as rescheduling or updating the event description.

3.4 DELETE EVENT

This module allows users to delete an event from the database by specifying its
Event ID. The program then executes an SQL DELETE query to remove the
selected event record from the database. This functionality is useful for removing
events that are no longer needed or have been canceled. It ensures that theevent
list remains up-to-date and accurate

8
3.5 EXIT EVENT

The exit module allows users to exit the program. When selected, the program
gracefully terminates, closing any active connections and exiting the application.
This module is important for properly ending the user session and ensuring that
the system shuts down without leaving any open resources.

Together, these modules form a complete event management system, providing


users with the ability to manage event data throughout its lifecycle. The program
facilitates event creation, updating, viewing, deletion, and proper termination of
the session, ensuring efficient event management.

9
CHAPTER 4

CONCLUSION & FUTURE SCOPE

4.1 CONCLUSION

In addition to providing fundamental event management functionalities, the


Event Management System is designed to be both flexible and scalable. Its
modular architecture allows for the addition of more features in the future,
such as advanced search and filtering capabilities, integration with payment
gateways, or even an automated email/notification system to inform
attendees about event updates. The system's simplicity ensures that it can be
used by various organizations, whether they are hosting small gatherings or
larger conferences. Furthermore, by leveraging Java and JDBC, the system
ensures that it can efficiently handle a large number of events and attendees,
providing users with a seamless experience while interacting with the
database.

The system also emphasizes security by using parameterized queries to


prevent SQL injection attacks, ensuring that the data entered by users
remains protected. The input validation, especially for crucial fields like
dates and times, guarantees that only valid and consistent data is stored in
the database. This reduces the possibility of errors or inconsistencies that
could affect event scheduling and attendance records.

Furthermore, while the current implementation uses a command-line


interface, future iterations could incorporate a graphical user interface
(GUI) to improve the user experience, making it more intuitive for users who
are not comfortable with command-line operations. With future
enhancements, such as multi-user support and advanced reporting features,
this Event Management System could serve as a comprehensive tool for

10
organizations of all sizes, offering a full range of capabilities to streamline
event planning and execution.

Ultimately, this system not only simplifies event management but also lays
the groundwork for a more advanced and feature-rich solution that can
address the evolving needs of event organizers and participants. It
demonstrates how core principles of software development can be applied to
create a useful and adaptable system that meets both current and future
requirements.

4.2 FUTURE SCOPE

In conclusion, the Event Management System serves as an efficient tool for


managing various event-related tasks, offering a robust framework for event
creation, viewing, updating, and deletion. By streamlining these processes, it
significantly reduces the manual effort and potential errors associated with
event management. The integration of a database ensures data consistency,
easy retrieval, and secure storage of event details, providing a reliable
platform for managing events of any scale.
Moreover, the system’s modular structure not only makes it easy to maintain
and enhance but also allows for seamless integration of additional features
such as attendee registration, payment processing, and advanced event
filtering. The adaptability of the system ensures that it can evolve according
to the growing demands of users and stakeholders. Future enhancements
could include the incorporation of real-time updates, mobile compatibility,
or cloud-based solutions to allow remote access and collaboration.
The system’s use of Java and JDBC offers a scalable solution, capable of
handling large datasets while maintaining optimal performance. Its user-
friendly interface and well-designed flow of operations make it easy for users

11
to navigate, even without technical expertise. Furthermore, by focusing on
security and validation at each step, the system ensures that user inputs are
safe, thereby preventing potential vulnerabilities such as SQL injection
attacks.
As technology continues to advance, the Event Management System
provides a strong foundation for future growth. By adding features such as
personalized event recommendations, social media integration, and
advanced data analytics, the system could cater to a wider range of users and
enhance the overall event experience for both organizers and attendees. This
system demonstrates how thoughtful design and modern programming
practices can come together to create an effective and sustainable solution
for event management needs.

12
.
APPENDIX A

1) EventManagement.java

import java.sql.*;
import java.util.Scanner;

public class EventManagement {


private static Connection connection = DatabaseConnection.getConnection();

// Create an event
public static void createEvent(String name, String date, String startTime,
String endTime, String description, String location, String whatsappLink, String
organizingCollege, String paymentMode) {
String query = "INSERT INTO Events (EventName, EventDate, StartTime,
EndTime, Description, Location, WhatsAppLink, OrganizingCollege,
PaymentMode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
try (PreparedStatement stmt = connection.prepareStatement(query)) {
stmt.setString(1, name);
stmt.setString(2, date);
stmt.setString(3, startTime);
stmt.setString(4, endTime);
stmt.setString(5, description);
stmt.setString(6, location);
stmt.setString(7, whatsappLink);
stmt.setString(8, organizingCollege);

13
stmt.setString(9, paymentMode);
stmt.executeUpdate();
System.out.println("Event created successfully!");
} catch (SQLException e) {
e.printStackTrace();
}
}

// Read all events


public static void readEvents() {
String query = "SELECT * FROM Events";
try (Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(query)) {

while (rs.next()) {
System.out.println("Event ID: " + rs.getInt("EventID"));
System.out.println("Event Name: " + rs.getString("EventName"));
System.out.println("Event Date: " + rs.getDate("EventDate"));
System.out.println("Start Time: " + rs.getTime("StartTime"));
System.out.println("End Time: " + rs.getTime("EndTime"));
System.out.println("Description: " + rs.getString("Description"));
System.out.println("Location: " + rs.getString("Location"));
System.out.println("WhatsAppLink:"
+rs.getString("WhatsAppLink"));
System.out.println("OrganizingCollege:"
+rs.getString("OrganizingCollege")); System.out.println("PaymentMode:"
+ rs.getString("PaymentMode")); System.out.println(" ");
}

14
} catch (SQLException e) {
e.printStackTrace();
}
}

public static void updateEvent(int eventId, String name, String date, String
startTime, String endTime, String description, String location, String
whatsappLink, String organizingCollege, String paymentMode) {
String query = "UPDATE Events SET EventName = ?, EventDate = ?,
StartTime = ?, EndTime = ?, Description = ?, Location = ?, WhatsAppLink = ?,
OrganizingCollege = ?, PaymentMode = ? WHERE EventID = ?";
try (PreparedStatement stmt = connection.prepareStatement(query)) {
stmt.setString(1, name);
stmt.setString(2, date);
stmt.setString(3, startTime);
stmt.setString(4, endTime);
stmt.setString(5, description);
stmt.setString(6, location);
stmt.setString(7, whatsappLink);
stmt.setString(8, organizingCollege);
stmt.setString(9, paymentMode);
stmt.setInt(10, eventId);
stmt.executeUpdate();
System.out.println("Event updated successfully!");
} catch (SQLException e) {
e.printStackTrace();
}
}

15
// Delete an event
public static void deleteEvent(int eventId) {
String query = "DELETE FROM Events WHERE EventID = ?";
try (PreparedStatement stmt = connection.prepareStatement(query)) {
stmt.setInt(1, eventId);
stmt.executeUpdate();
System.out.println("Event deleted successfully!");
} catch (SQLException e) {
e.printStackTrace();
}
}

public static void main(String[] args) {


Scanner scanner = new Scanner(System.in);
System.out.println("Event Scheduler Management");
System.out.println("1. Create Event");
System.out.println("2. View Events");
System.out.println("3. Update Event");
System.out.println("4. Delete Event");
System.out.println("5. Exit");

while (true) {
System.out.print("Choose an option: ");
int choice = scanner.nextInt();
scanner.nextLine(); // Consume newline

switch (choice) {
case 1:

16
System.out.print("Enter Event Name: ");
String name = scanner.nextLine();
System.out.print("Enter Event Date (YYYY-MM-DD): ");
String date = scanner.nextLine();
System.out.print("Enter Start Time (HH:MM:SS): ");
String startTime = scanner.nextLine();
System.out.print("Enter End Time (HH:MM:SS): ");
String endTime = scanner.nextLine();
System.out.print("Enter Description: ");
String description = scanner.nextLine();
System.out.print("Enter Location: ");
String location = scanner.nextLine();
System.out.print("Enter WhatsApp Link: ");
String whatsappLink = scanner.nextLine();
System.out.print("Enter Organizing College: ");
String organizingCollege = scanner.nextLine();
System.out.print("Enter Payment Mode (Online/Offline): ");
String paymentMode;
while (true) {
paymentMode = scanner.nextLine();
if(paymentMode.equalsIgnoreCase("Online") ||
paymentMode.equalsIgnoreCase("Offline")) {
break;
} else {
System.out.println("Invalid input. Please enter 'Online' or
'Offline'.");
System.out.print("Enter Payment Mode (Online/Offline): ");
}
}

17
createEvent(name, date, startTime, endTime, description, location,
whatsappLink, organizingCollege, paymentMode);
break;
case 2:
readEvents();
break;
case 3:
System.out.print("Enter Event ID to update: ");
int updateId = scanner.nextInt();
scanner.nextLine(); // Consume newline
System.out.print("Enter New Event Name: ");
String newName = scanner.nextLine();
System.out.print("Enter New Event Date (YYYY-MM-DD): ");
String newDate = scanner.nextLine();
System.out.print("Enter New Start Time (HH:MM:SS): ");
String newStartTime = scanner.nextLine();
System.out.print("Enter New End Time (HH:MM:SS): ");
String newEndTime = scanner.nextLine();
System.out.print("Enter New Description: ");
String newDescription = scanner.nextLine();
System.out.print("Enter New Location: ");
String newLocation = scanner.nextLine();
System.out.print("Enter New WhatsApp Link: ");
String newWhatsappLink = scanner.nextLine();
System.out.print("Enter New Organizing College: ");
String newOrganizingCollege = scanner.nextLine();
System.out.print("Enter New Payment Mode (Online/Offline): ");
String newPaymentMode;
while (true) {

18
newPaymentMode = scanner.nextLine();
if (newPaymentMode.equalsIgnoreCase("Online") ||
newPaymentMode.equalsIgnoreCase("Offline")) {
break;
} else {
System.out.println("Invalid input. Please enter 'Online' or
'Offline'.");
System.out.print("Enter New Payment Mode (Online/Offline):
");
}
}
updateEvent(updateId, newName, newDate, newStartTime,
newEndTime, newDescription, newLocation, newWhatsappLink,
newOrganizingCollege, newPaymentMode);
break;
case 4:
System.out.print("Enter Event ID to delete: ");
int deleteId = scanner.nextInt();
deleteEvent(deleteId);
break;
case 5:
System.out.println("Exiting...");
System.exit(0);
default:
System.out.println("Invalid option. Try again.");
}
}
}
}

19
2) SQL queries

CREATE DATABASE EventManagement;

USE EventManagement;

CREATE TABLE Events (


EventID INT AUTO_INCREMENT PRIMARY KEY,
EventName VARCHAR(100) NOT NULL,
EventDate DATE NOT NULL,
StartTime TIME NOT NULL,
EndTime TIME NOT NULL,
Description TEXT NOT NULL,
Location VARCHAR(200) NOT NULL,
WhatsAppLink VARCHAR(255),
OrganizingCollege VARCHAR(100),
PaymentMode ENUM('Online', 'Offline') NOT NULL
);

INSERT INTO Events (EventName, EventDate, StartTime, EndTime,


Description, Location, WhatsAppLink, OrganizingCollege, PaymentMode)
VALUES
('Tech Summit', '2024-12-15', '10:00:00', '16:00:00', 'A technology summit on
AI and ML', 'Tech Park, City Center', 'https://wa.me/1234567890', 'Tech
University', 'Online'),
('Cultural Fest', '2024-12-20', '14:00:00', '20:00:00', 'An inter-college cultural
fest', 'Grand Auditorium', 'https://wa.me/0987654321', 'City College', 'Offline');

20
APPENDIX B
(SCREENSHOTS)

1) CREATE EVENT

2) VIEW EVENT

21
3) UPDATE EVENT

4) DELETE EVENT

5) EXIT EVENT

22
SQL Tables

23
REFERENCES

1) Creating a java project in vscode -


https://youtu.be/79YpKXnjKeo?si=5az6Xle3lIrad-AL
2) Collections in Java - https://www.geeksforgeeks.org/collections-in-java-2/
3) Resolving and handling exceptions and errors in Programs -
https://stackoverflow.com/
4) SQL queries - https://www.w3schools.com/sql/sql_syntax.asp
5) Performing database operations in Java -
https://www.geeksforgeeks.org/performing-database-operations-java-sql-
create-insert-update-delete-select/
6) JDBC concepts
i. https://youtu.be/7v2OnUti2eM?si=wW0xG7-pOoM47znj
ii. https://www.geeksforgeeks.org/establishing-jdbc-connection-in-
java/

7) Youtube link for reference of database connectivity


https://youtu.be/bsDzjy85Lpw?si=iar2nGGeaFYduCuC

8) For error clearing by stack overflow

https://stackoverflow.com/questions/5556664/how-to-fix-no-suitable-
driver-found-for-jdbcmysql-localhost-dbname-error-w

9) Comprehensive guides on Java libraries, JDBC, and SQL


integration.

https://docs.oracle.com/javase/tutorial/

10) Comprehensive guides on Java libraries, JDBC, and SQL


integration.

https://docs.oracle.com/javase/tutorial/

24

You might also like