|
| Advance Java | IndianTechnoEra |
Aim:
Create a java jsp program to enter the new employee details from an HTML form into the Employee table
Process:
1. Create a project (dynamic web)
2. Create a html file and design the form page for taking employee detail to add.
3. Give the proper input name to get the value
4. Create a new .jsp file in same web folder of the project
5. Give the jsp file name into the .html file at the form action value with extension. Jsp
6. Write the code in .jsp file as follow
a. Get html form value in jsp file with new defined variable
b. Start try and catch block
c. Create my database connection
d. Define the query for database implementation
e. Prepare statement with value of table
f. Define the return type ui code with out.print(“”);
7. Pate MySQL driver in web folder
a. build path of project with class section to select the MySQL driver
b. build path of project with module path to select the jsp api file from the tomcat dir
8. Save all the file and run as project with local server tomcat
Input:
Output:
![]() |
| JSP to Enter New Employee Data in Database Success |
![]() |
| JSP to Enter New Employee Data in Database Fail when left ID |


