Chapter 1
INTRODUCTION
6.3 OBJECTIVE OF SDA
The main goal of this Skill Development Activity (SDA) is to create, implement, and deploy
a complete Online Bookstore Web Application using major components of Advanced Java
like Servlets, JSP, JDBC, and MySQL. This project will mimic an actual e-commerce system
specifically designed for the sale and management of books online. With this project, the
objective is to achieve a platform on which users will be able to browse, search, choose, and
buy books, and supply administrators with features to efficiently handle inventory, sales, and
user data.
This SDA is an exercise in end-to-end application of theoretical knowledge acquired through
classroom sessions to a real-world, problem-solving context. The functionalities involved are
user registration, login/logout, management of book catalogs, cart operations, and admin
modules. The architecture is based on the Model-View-Controller (MVC) pattern to provide
separation of concerns and maintainability.
The project aims to enhance backend skills by incorporating Java Servlets and database
interactions via JDBC. It also assists in learning the client-server communication process,
session handling, and user authentication essentials of any enterprise-level Java application.
1.2 IMPORTANCE OF THE ACTIVITY
In the present digital age, e-commerce applications have become unavoidable for offering
convenience, accessibility, and automation to businesses and users alike. The Online
Bookstore SDA is an example of real-world application usage, illustrating how Java
technologies can be employed for solving day-to-day business issues with web-based
solutions. This project not only enhances the grip on Java EE technologies but also illustrates
how to develop scalable, modular, and secure web applications.
The significance of this exercise is that it helps fill the gap between academic learning and
actual application of Servlets and JDBC in developing backend business logic and database
interaction.
1
It provides students with a platform to practice and comprehend the real application of
Servlets and JDBC in executing backend business logic and database interactions. Through
the exercise of this project, students learn how to set up and deploy web applications on
servers such as Apache Tomcat and integrated development environments such as Eclipse.
In addition to this, SDA promotes team-based thinking, problem-solving, and following the
best practices for software development. It helps greatly in improving skills in project
planning, version management, UI/UX design, and testing. Such hands-on learning is of
immense value because it makes the students industry-expected in terms of Java web
development.
1.3 EXPECTED LEARNING OUTCOMES
By finishing this Skill Development Activity, students should have considerable hands-on
practice in creating Java-based web applications. The greatest achievement is becoming
proficient in using Java Servlets and JDBC to create dynamic, data-driven web interfaces.
Students will be taught to install and work with a MySQL database, manage HTTP requests
and responses, use session management, and apply appropriate security practices for user
authentication and data management.
Students will also be taught how to design their application using the MVC pattern, which
helps ensure cleaner and more maintainable code. Introduction to HTML, CSS, and JSP for
front-end development will also assist students in designing intuitive and responsive user
interfaces. They will know how to deploy their applications on Apache Tomcat, which is a
crucial skill for enterprise web development.
Other practical learning outcomes include testing and debugging Java web applications,
dealing with SQL queries, and handling CRUD operations. Students will also acquire soft
skills such as documentation, teamwork (if it is collaborative), and time management. By the
completion of the project, students will be assured of creating real-world applications and
will be more suited for full-time positions like Java Developer, Web Application Engineer, or
Full Stack Developer.
2
Chapter 2
PROBLEM STATEMENT / TASK DESCRIPTION
2.1 DEFINE THE TASK ASSIGNED
The assigned task for this Skill Development Activity is to design and implement a full-
fledged Online Bookstore Web Application using Advanced Java technologies, specifically
Servlets, JSP, and JDBC. The project requires developing a dual-interface platform one for
end users (customers) and another for administrators (store managers). The user interface
must allow customers to browse available books, search for specific titles, register or log in to
their accounts, add books to a cart, and simulate a checkout process. Meanwhile, the admin
panel should allow authorized personnel to manage the book inventory, update book details,
monitor orders, and oversee overall application operations.
This project involves database integration using MySQL, where all book-related information,
user data, transaction records, and admin credentials are securely stored and managed. The
application should follow the Model-View-Controller (MVC) architecture to separate logic,
interface, and data layers for better organization and scalability.
In addition, the web application should ensure session handling, authentication mechanisms,
and basic security measures to safeguard user data. The task requires modular coding
practices, clean UI development using HTML/CSS/JS, and deployment of the application on
a local server such as Apache Tomcat.
2.2 SIGNIFICANCE OF THE PROBLEM IN REAL-WORLD APPLICATIONS
The concept of an online bookstore addresses a highly relevant real-world problem making
books accessible to a broader audience through digital platforms. In today’s fast-paced and
digitally connected environment, traditional bookstores are limited by geography, operational
hours, and physical inventory constraints. An online bookstore removes these barriers by
offering 24/7 access to a wide catalogue of books, efficient search and filtering options, and
seamless order placement, all from the comfort of the user’s home.
This project mirrors real-world e-commerce systems such as Amazon and Flipkart, which
dominate the retail industry today. The features developed in this application user
authentication, product listing, cart management, and backend inventory control are all key
3
components of a modern-day online marketplace. By solving this problem at a miniature
scale, students gain insight into the complexities involved in building scalable and secure e-
commerce platforms.
From an academic perspective, this SDA not only enhances technical proficiency in Java-
based web development but also fosters business logic understanding and customer-centric
design. It helps students explore the software development lifecycle in a practical way,
preparing them for real-world job roles in full stack development, web engineering, and Java
enterprise solutions. Moreover, such applications are crucial in educational and niche markets
where specialized books can be sold online to targeted audiences.
4
Chapter 3
SOFTWARE & HARDWARE REQUIREMENTS
3.1 SOFTWARE
Java Development Kit (JDK) 8 or above
Eclipse IDE or NetBeans
Apache Tomcat Server (version 9.0 or higher)
MySQL Database Server
JDBC (Java Database Connectivity)
Web Technologies: HTML, CSS, JavaScript
Web Browser (Chrome, Firefox, etc.)
3.2 HARDWARE
Processor: Intel Core i3 or higher
RAM: Minimum 4 GB (8 GB Recommended)
Hard Disk: Minimum 500 GB
Operating System: Windows 10 / 11, Linux (Ubuntu preferred), or macOS
5
Chapter 4
DESIGN & ARCHITECTURE
4.1 SYSTEM ARCHITECTURE / FLOW DIAGRAM
SYSTEM ARCHITECTURE
The system architecture of the Online Bookstore illustrates the structured interaction between
the user interface, application logic, and database using the Laravel MVC framework.
Figure 4.1.1 System Architecture
The system architecture of the Online Bookstore, showcasing the flow between users, Laravel
MVC components, and the MySQL database.
6
DATA FLOW DIAGRAM
The Data Flow Diagram shows the flow of data or information. It can be partitioned into
single processes or functions. Data Flow Diagrams can be grouped together or decomposed
into multiple processes. There can be physical DFD’s that represent the physical files and
transactions, or they can be business DFD’s (logical, or conceptual).
Level – 0 DFD
Figure 4.1.2 Level – 0 DFD – Context Diagram
Level – 1 DFD
Figure 4.1.3 Level – 1 DFD – DFD for Admin Process
7
Level – 2 DFD
Figure 4.1.4 Level – 2 DFD – DFD for User Registration & Profile Update
Figure 4.1.5 Level – 2 DFD – DFD for Shopping and Checkout process
8
4.2 USE CASE DIAGRAM / CLASS DIAGRAM
USE CASE DIAGRAM
The use case diagram illustrates the interactions between users (admin and customer) and the
core functionalities of the Online Bookstore system.
Figure 4.2.1 Use Case Diagram
9
CLASS DIAGRAM
The class diagram showcases the system’s main classes, their attributes, methods, and the
relationships between them in the Online Bookstore application.
Figure 4.2.2 Class Diagram
10
Chapter 5
IMPLEMENTATION
5.1 TECHNOLOGY STACK
The Online Bookstore is developed using the Java EE stack and deployed on Apache
Tomcat. The key technologies used includes:
Java – Core programming language for backend logic and business operations.
Servlets – Used to handle HTTP requests and responses, acting as the controller in
MVC.
JSP (Java Server Pages) – For generating dynamic content on the frontend (View
layer).
JDBC (Java Database Connectivity) – To connect and interact with the MySQL
database.
HTML/CSS/JavaScript – Used in JSP files to build interactive and responsive UI.
MySQL – For storing user information, books, orders, and admin data.
Apache Tomcat – Serves as the web server and servlet container for deploying the
project.
5.2 CODE SNIPPETS / KEY FUNCTIONAL MODULES
CODE SNIPPETS
6. User Registration (Servlet)
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
String username = [Link](“username”);
String password = [Link](“password”);
try (Connection con = [Link]()) {
String sql = “INSERT INTO users (username, password) VALUES (?, ?)”;
PreparedStatement stmt = [Link](sql);
[Link](1, username);
[Link](2, password);
[Link]();
[Link](“[Link]”);}
catch (Exception e) {
[Link]();
}}
11
2. Book Listing (Servlet + JSP)
Servlet:
List<Book> books = [Link]();
[Link](“books”, books);
[Link](“[Link]”).forward(request, response);
[Link]:
<c:forEach var=”book” items=”${books}”>
<div class=”book”>
<h3>${[Link]}</h3>
<p>Author: ${[Link]}</p>
<p>Price: ₹${[Link]}</p>
<a href=”BuyServlet?bookId=${[Link]}”>Buy Now</a>
</div>
</c:forEach>
3. Admin – Add Book Module
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
String title = [Link](“title”);
String author = [Link](“author”);
double price = [Link]([Link](“price”));
try (Connection con = [Link]()) {
String sql = “INSERT INTO books (title, author, price) VALUES (?, ?, ?)”;
PreparedStatement stmt = [Link](sql);
[Link](1, title);
[Link](2, author);
[Link](3, price);
[Link]();
[Link](“[Link]”);
} catch (Exception e) {
[Link]();
}
}
4. Database Connection Utility ([Link]):
public class DBUtil {
public static Connection getConnection() throws SQLException, ClassNotFoundException
{
[Link](“[Link]”);
return [Link](“jdbc:mysql://localhost:3306/bookstore”, “root”,
“your_password”);
}
}
12
KEY FUNCTIONAL MODULES
1 User Authentication Module
Handles user registration, login, session management, and logout functionality using
Servlets and JDBC.
2 Book Browsing & Search Module
Allows users to browse books by category, view details, and search by title or author via
JSP pages backed by Servlets.
3 Shopping Cart Module
Enables users to add books to a virtual cart, view selected items, update quantities, and
proceed to checkout.
4 Order Processing Module
Handles placing orders, order confirmation, and stores order details in the database.
5 Admin Module
Admin can add, update, delete book entries and view sales or user data. Provides
backend management via a secure login.
6 Database Interaction Layer (DAO Module)
Encapsulates all database operations (CRUD) using JDBC in a modular and reusable
manner.
7 Session Management
Maintains user sessions for secure navigation and access control across the application.
8 Feedback/Review Module (Optional/Extended)
Allows users to submit reviews or ratings for books, enriching the system with user-
generated content.
13
5.3 SCREENSHOTS OF UI
HOME PAGE
Figure 5.3.1 Home Page
USER LOGIN PAGE
Figure 5.3.2 User Login Page
14
USER – BOOK BROWSING PAGE
Figure 5.3.3 User – Book Browsing Page
USER – SHOPPING CART PAGE
Figure 5.3.4 User – Shopping Cart Page
15
USER – CHECKOUT ORDER CONFIRMATION PAGE
Figure 5.3.5 User – Checkout Order Confirmation Page
ADMIN LOGIN PAGE
Figure 5.3.6 Admin Login Page
16
ADMIN – DASHBOARD PAGE
Figure 5.3.7 Admin – Dashboard Page
ADMIN – ADD BOOKS PAGE
Figure 5.3.8 Admin – Add Books Page
17
ADMIN – REMOVE BOOKS PAGE
Figure 5.3.9 Admin – Remove Books Page
REGISTER PAGE
Figure 5.3.10 Register Page
18
Chapter 6
TESTING
6.1 UNIT TESTING
Unit testing is the process of testing individual components or modules of a software system
to ensure they work as intended in isolation. In the context of an Online Bookstore Web
Application, unit tests are written to test specific Java classes such as UserDAO, BookDAO,
or CartManager. These tests focus on validating the business logic like whether the method to
calculate total cart value returns the correct result, or whether a book is successfully added to
the database.
Tools like Junit are commonly used for unit testing in Java projects. Unit testing is critical
because it helps developers identify and fix bugs early in the development process. It also
improves code quality by ensuring that each function behaves correctly under different
conditions. Since these tests are independent, they run fast and can be automated easily as
part of a CI/CD pipeline. By covering various edge cases, unit testing provides confidence
that individual parts of the application are stable and reliable.
6.2 INTEGRATION TESTING
Integration testing is performed to verify that different modules or services in the application
work together as expected. In a layered architecture like the one used in this project (Java
Servlets, JSP, JDBC), it’s essential to test how the UI layer, controller (Servlet), and
backend/database layer interact.
For example, when a user submits a registration form, integration testing checks if the form
data flows correctly from the JSP page to the servlet and then to the database through the
DAO class. It also ensures that database responses are correctly sent back to the user
interface. Integration testing helps catch issues like mismatched data types, improper
exception handling, or failed database connections that unit tests might miss.
Tools like Mockito, TestNG, or simple manual tests using browser tools or Postman can be
used. Integration testing is key to validating real-world workflows in the application, ensuring
that combined units deliver the intended behavior.
19
6.3 SYSTEM TESTING
System testing is a high-level testing process that evaluates the complete and integrated
system to ensure it meets the specified requirements. In the case of the Online Bookstore
Web Application, system testing checks the overall functionality from user registration,
browsing books, and searching, to making a purchase and generating reports.
Unlike unit or integration tests, system testing is conducted in an environment that closely
mirrors the production setup, including the web server (Apache Tomcat), the database
(MySQL), and the browser UI. This type of testing typically involves both functional testing
(checking that features work) and non-functional testing (like performance or security
testing). Test cases are written based on real user scenarios, such as: “Can a user log in and
purchase a book successfully?” or “Can the admin delete a book and verify it’s removed from
the list?” It also includes negative test cases like incorrect login credentials or trying to buy a
book with zero stock.
The goal of system testing is to validate the system as a whol“, ensuring it behaves as
expected across all modules. It provides confidence before final deployment, as it simulates
actual user interactions with the complete application.
20
RESULTS
The Online Bookstore Web Application was successfully implemented and later tested
without omissions of other core requirements provided for in the project scope. Users were
able to register, log in, browse available books, search via keywords, put books into their
carts, and purchase them without a hitch as well. The admin panel was also much perfect as it
enabled the administrators to manage the inventory, add or remove books, and track sales
records in real time. The coalescence of Java Servlets, JSP, and JDBC ensured excellent
communication between frontend and backend.
From a user experience, it is intuitive, responsive, easy-to-use between all possible screen
sizes, and during performance tests, it was able to handle many users without lagging. It
turned out that system testing also claimed that the application was reliable in real life, with
both negative and positive flows receiving expected test results.
Also checked were some security features like input validation and session management. The
project also demonstrated modularity and maintainability, facilitating any future upgrade or
feature addition. Overall, the project is a successful effort for what it intended to achieve,
showcasing a complete, end-to-end e-commerce system using Java-based web technologies.
21
CONCLUSION
The development of the Online Bookstore Web Application under the Skill Development
Activity (SDA) provided me well. It provided absolutely established application of theory to
an online project. The full-stack development of application was carried out using Java
technologies based on Servlets, JSP, JDBC, and MySQL hosted under Apache Tomcat. Then
the activity provided much experience in building a dynamic, user-friendly web application
for book browsing and buying, as well as managing the books.
What it explains was about how to understand how to construct that code more scalable-
maintainable way toward the Model-View-Controller (MVC) architecture. There was JDBC,
where database interactions were pretty solid and where JSP had incorporated dynamic
content rendering. This really boosted the skills in user authentication, session handling, and
form validation.
The project also trained on some soft skills such as problem-solving, debugging, and working
within structured timelines. It underlined the importance of testing and documenting an
application, not omitting its UI/UX aspects.
Thus, the project made a great contribution to teaching with theoretical concepts and
derailing it into practical applications, preparing one for much-needed roles in web
development and software engineering fields in times to come.
22
REFERENCES
Books:
“Head First Servlets and JSP” by Bryan Basham, Kathy Sierra, Bert Bates – For
understanding Java Servlets, JSP, and web app architecture.
“Java: The Complete Reference” by Herbert Schildt – For core Java concepts and
JDBC integration.
Websites:
[Link] – Official Java EE documentation for Servlets and
JSP.
[Link] – For tutorials on Java, JSP, Servlets, and JDBC.
[Link] – For practical coding examples and Java
programming guidance.
[Link] – For resolving coding issues and implementation
doubts.
YouTube Channels:
Telusko – For video tutorials on Java web development.
CodeWithHarry – For understanding Servlets and JDBC step-by-step.
Tools and Software:
Apache Tomcat (v9) – Deployment server.
NetBeans / Eclipse IDE – For coding and debugging.
MySQL – For backend database management.
23