From the course: Java EE 7: Web Services

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Delete data via an endpoint

Delete data via an endpoint - Java EE Tutorial

From the course: Java EE 7: Web Services

Start my 1-month free trial

Delete data via an endpoint

- [Instructor] Let's look at deleting data using a SOAP-based web service. I've opened the project in IntelliJ and I've navigated to the interface file for the application service. Notice down on line 27, the definition for our deleteApplication method and notice we're passing in an id of the application that we want to delete. So, let's navigate to the ApplicationService file and on line 102 notice the implementation for our deleteApplication. So, on line 104, I'm getting a connection and creating a statement. On line 105, I'm calling the executeUpdate on that statement and notice I'm passing in a delete SQL statement, so DELETE FROM TZA_APPLICATION where the id matches the id that's passed in. I'm handling generic exceptions here on line 107 which will return false. Now, if all goes well and we're able to delete the application, I am returning true. So, here we've navigated to the ApplicationClient file and if we scroll down to line 37, notice we are calling the deleteApplication on…

Contents