Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page import="java.sql.*" %>
- <%ResultSet resultset =null;%>
- <HTML>
- <HEAD>
- <TITLE>Select element drop down box</TITLE>
- </HEAD>
- <BODY>
- <h1>ACME LIMITED</h1><br>
- <h2>EMPLOYEE DETAILS</h2>
- <br>
- <form action = "Form.jsp">
- <button type = "submit">Add New Employee</button>
- </form>
- <%
- try{
- Class.forName("com.mysql.jdbc.Driver").newInstance();
- Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/hirarchy_check","root","root@123");
- Statement statement = connection.createStatement() ;
- resultset =statement.executeQuery("select * from employee_details") ;
- %>
- <table border = 1>
- <tr><th>Employee Id</th><th>Employee Name</th><th>Employee Designation</th><th>Reporting Manager</th><th>View</th></tr>
- <%
- while(resultset.next())
- { %>
- <tr><td><%=resultset.getInt(1)%></td><td><%=resultset.getString(2)%></td><td><%=resultset.getString(3)%></td><td><%=resultset.getString(4)%></td><td><a href = 'FormUpdate.jsp'>View</a></td></tr>
- <% }%>
- </table>
- <% }
- catch(Exception e)
- {
- out.println(e);
- }
- %>
- </BODY>
- </HTML>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement