Ebook Management System (JSP-Servlet-MySQL)
A full-stack web application developed using JSP, Servlets, and MySQL, designed to manage eBook transactions. This system allows users to register, log in, order books, and sell used books, while the admin can manage users, books, and orders.
Backend: Java (JDK 1.8), Servlet, JSP, JSTL Frontend: HTML5, CSS3, Bootstrap4 and FontAwesome Database: MySQL Server: Apache Tomcat 10.1 JDBC: MySQL Connector/J
Register a new account Login/Logout Order available books Add old books for selling (includes name, author, price, condition, image) View and delete their listed books View order history Search for books
Login to admin dashboard View and delete users Add new books Delete any book (including user-uploaded) View all orders placed by users
graphql ebook-management/ │ ├── src/ │ ├── dao/ # Data access layer (DB operations) │ ├── model/ # POJO classes for Book, User, Order etc. │ ├── servlet/ # Servlet controllers for user/admin actions ├── WebContent/ │ ├── jsp/ # JSP pages (views) │ ├── images/ # Uploaded book images │ ├── WEB-INF/ │ │ └── web.xml # Deployment descriptor │ │ └── pom.xml │ ├── lib/ # MySQL JDBC driver (mysql-connector-java.jar) └── README.md
Java JDK 1.8 Apache Tomcat 10.1 MySQL Server (5.7+) IDE (Eclipse/IntelliJ/NetBeans) MySQL JDBC Driver
Create a database:
create database ebook; use ebook;
Create necessary tables:
CREATE TABLE user (
ID int NOT NULL AUTO_INCREMENT,
FullName varchar(100) NOT NULL,
PhoneNo varchar(20) DEFAULT NULL,
Email varchar(100) NOT NULL,
Password varchar(100) NOT NULL,
Address varchar(100) DEFAULT NULL,
City varchar(50) DEFAULT NULL,
State varchar(50) DEFAULT NULL,
PinCode int DEFAULT NULL,
PRIMARY KEY (ID))
CREATE TABLE book_details (
bookId int NOT NULL AUTO_INCREMENT,
bookName varchar(70) DEFAULT NULL,
author varchar(70) DEFAULT NULL,
price varchar(50) DEFAULT NULL,
bookCategory varchar(45) DEFAULT NULL,
status varchar(45) DEFAULT NULL,
photo varchar(45) DEFAULT NULL,
email varchar(70) DEFAULT NULL,
PRIMARY KEY (bookId))
CREATE TABLE cart (
cid int NOT NULL AUTO_INCREMENT,
bid int DEFAULT NULL,
uid int DEFAULT NULL,
bookName varchar(70) DEFAULT NULL,
author varchar(70) DEFAULT NULL,
price double DEFAULT NULL,
total_price double DEFAULT NULL,
PRIMARY KEY (cid))
CREATE TABLE book_orders (
id int NOT NULL AUTO_INCREMENT,
order_id varchar(45) DEFAULT NULL,
user_name varchar(45) DEFAULT NULL,
email varchar(45) DEFAULT NULL,
address varchar(500) DEFAULT NULL,
phone varchar(45) DEFAULT NULL,
book_name varchar(55) DEFAULT NULL,
author varchar(55) DEFAULT NULL,
price varchar(45) DEFAULT NULL,
payment varchar(45) DEFAULT NULL,
PRIMARY KEY (id))
String url = "jdbc:mysql://localhost:8080/ebookdb"; String user = "root"; String password = "12345";
Clone or download this repository. Import it into your IDE as a Dynamic Web Project. Add the MySQL JDBC driver to the lib/ directory. Configure the web.xml file and servlet mappings. Deploy the app on Tomcat 10.1. Visit: http://localhost:8080/ebook
Email: admin@gmail.com Password: admin
This project helps us in online library, users and orders management for the admin and provides an interface to the user to buy and sell old books, manage orders and edit profile. It uses database for storing information of books, users, cart and orders. Admin can add or delete new and old books while user can also add old books to sell and toggle book status between active and inactive. Users can also search books and the website has a contact us page.
You are free to use, modify, and distribute it for personal or educational use.
Mohd Kamran Khan















