Lab02.2 JDBC WebApp
Lab02.2 JDBC WebApp
Lab Objectives
In this lab, you will be:
▪ Create Java web project using the NetBean IDE
▪ Create the web pages by HTML
▪ Apply passing data from HTML to Servlet by GET and POST method
1|Page
▪ Performs CRUD functions by SqlJDBC driver and SQL Server
▪ Run the project and test the functions of the application
2|Page
Step 02. Write codes for the classes in the DBUtils package as the follows:
• User.java
• UserDAO.java
3|Page
4|Page
5|Page
6|Page
Step 03. Write codes for the classes in the UserServlet package as the
follows:
• LoginServlet.java
7|Page
• ProcessUserServlet.java
8|Page
• ManageUserServlet.java
9|Page
Step 04. Write HTML codes for the web pages as the follows:
• Login.html page
• AddUser.html page
• DeleteUser.html page
10 | P a g e
• UpdateUser.html page
Step 05. Open the web.xml in the WEB-INF folder then update as the follows:
Step 06. Right-click on IntroductionJDBC project, select Run to run the web
app then test all functions.
11 | P a g e