|
| Advance Java | IndianTechnoEra |
Aim:
Create a java jsp program to delete an employee from the employee table.
Process:
1. Create a project (dynamic web)
2. Create a html file and design the form page for taking employee id to delete.
3. Give the proper input id name attribute to get the value of id of employee.
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 query1 for database implementation to display the deleting the data
e. Prepare statement and setString with query1 with prepare statement 1
f. ResultSet with prepare statement 1 and executeQuery
g. Define the query2 for database implementation to proper delete the date
h. Prepare statement and setString with query2 with prepare statement 2
i. In try catch define return type UI code with out.print() to display the data.
7. Pate MySQL driver mysql-connector in Referenced Libraries and WEB-INF > lib
8. Save all the file and run as project with local server tomcat
Input:
Output:
|
| JSP to delete employee data from database |

