Coders Packet

E-Commerce Website built using Java, JSP, Servlets and Hibernate with Database in MySQL

By Abhinav Goswami

This is a dynamic web application project which basically lets the user buy a limited number of books and then gives them a confirmation.

Tools used to create the project

1) Eclipse IDE

2) JDK 8 or higher

3) Apache Tomcat Server 8.5.63 (server)

4) MySQL-connector-java-5.1.23-bin.jar

5) Hibernate ORM - 5.3.20 JAR Files

6) My-SQL Workbench/Command-Line-Client 5.2 CE

Project Pre-requisites

1) Must have java installed on the system

2) IDE to run the project

3) Tomcat Apache server setup (download JAR files from the internet)

4) my-SQL-connector jar file

5) Hibernate ORM - 5.3.20 JAR files

6) Download MySQL Workbench or command-line-client 5.2 CE on the system.

Import the database (.sql) file using-->

mysql -u username -p database_name > file.sql //command- use full path instead of "file.sql".

All these JAR files must be added to the project build path.

Although the project already contains server JAR files and MySQL connector JAR file- do check whether the server is running or not.

The project folder also contains the database file(.sql)--> (database_name: bookstore, table_names: 1- books, 2- order_details, 3- usertable).

Copy the hibernate jar files inside the lib folder also.

Project Details

1) Project contains multiple packages one of them being user package which uses the concept of hibernate mapping to store the data objects inserted by the user as a "new user registration on userRegistration.jsp page" inside the MySQL database.

2) The dependencies and connections to register user using hibernate is made inside the hiberante.cfg.xml file.

3) Two hibernate mapping files are created namely "books.hbm.xml" and "user1.hbm.xml" to connect with the database.

4) Multiple JSP and servlets files are created to insert order_details of the book and its quantity which is purchased by the user.

5) When user selects a book and enter the quantity -> on the confirmation page the data(username, book selected, quantity) is shown in a structured table.

6) User can also update his password using "forgot password?" option on the login page which redirects him to the forgotPassword.jsp page to update his password for which the request is made to a servlet named "FP".

7) Slight use of javascript is also made to toggle password visibility.

8) After the user buys books he is redirected to "thanks.jsp" page which shows a confirmation message and then again the control is redirected finally to the "" page.

9) Run the project by right-clicking -> run-as -> run on server on login.jsp page (inside -> WebContent -> WEB-INF Page). The project shall run successfully if the server is set up properly.

Project Images:



/* Developed by Abhinav Goswami - Java Programmer Intern at CodeSpeedy Technology Private Ltd. */



Download Complete Code


No comments yet