Practical 7 : JSP to Enter New Employee Data in Database - IndianTechnoEra
Latest update Android YouTube

Practical 7 : JSP to Enter New Employee Data in Database

Create a java jsp program to enter the new employee details from an HTML form into the Employee table
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

Post a Comment

Feel free to ask your query...
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.