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 - Java EE Tutorial
From the course: Java EE 7: Web Services
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Understand SOAP services1m 29s
-
(Locked)
Create a JAX-WS endpoint4m 55s
-
(Locked)
Implement SOAP clients in Java4m 8s
-
(Locked)
Retrieve data via an endpoint3m 25s
-
(Locked)
Create data via an endpoint2m 24s
-
(Locked)
Update data via an endpoint2m 6s
-
(Locked)
Delete data via an endpoint2m
-
(Locked)
Map to entities with JAXB3m 50s
-
(Locked)
-
-
-