Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HTTP Status 405 - Method Not Allowed
- type Status report
- message Method Not Allowed
- description The specified HTTP method is not allowed for the requested resource.
- @DELETE
- @Path("/delete")
- @Produces(MediaType.TEXT_HTML)
- public void delEmployeeFormParam(@FormParam("Employee_id") int employee_id){
- java.net.URI location= null;
- System.out.println("teting");
- try
- {
- Class.forName("com.mysql.jdbc.Driver");
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/Employee_db", "root", "root");
- String query = "delete from employee where emp_id = (?)";
- PreparedStatement st = con.prepareStatement(query);
- st.setInt(1, employee_id);
- st.executeQuery();
- }
- catch (Exception e)
- {
- System.out.println(e.getMessage());
- }
- }
- <body>
- <h3> Enter Employee Id to Delete </h3>
- <div>
- <form method="DELETE" action="http://localhost:8080/RESTCRUD/rest/employee/delete">
- <p>Employee Id: <input type:"text" name="Employee_id"/></p>
- <input type="submit" value="submit"/>
- </form>
- </div>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement