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.

Create data via an endpoint

Create data via an endpoint - Java EE Tutorial

From the course: Java EE 7: Web Services

Start my 1-month free trial

Create data via an endpoint

- [Instructor] Let's look at creating data using a SOAP-based web service. So let's look at the definition of our addApplication method on line 21. So I've opened the porject in IntelliJ and I've navigated to the interface file for ApplicationService.java. And now let's look at the implementation of addApplication, so let's click on ApplicationService.java, and let's scroll down to line 67 where we define this method. So here we have the addApplication method. Notice on line 69 I'm getting a database connection and creating a statement. On line 70 I'm calling the executeUpdate method that's actually inserting a new application into the TZA_APPLICATION table. And then notice on line 74 I'm catching the SQLIntegrityConstraintViolationException. Now this occurs when attempting to insert a duplicate record into a database. I'm also catching a generic exception here on line 76. Now if the insert statement is successful, line 81 returns a value of true, indicating the insert was a success…

Contents