Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 63 Insurance
- 536.4K On-Premises Infrastructure
- 138.3K Analytics Software
- 38.6K Application Development Software
- 5.8K Cloud Platform
- 109.5K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71.1K Infrastructure Software
- 105.3K Integration
- 41.6K Security Software
Validation if database correctly executed

hello good day everyone,
So I have a java code like this
MessageExceptionDTO result = obatService.ObatDelete(obat);
if (result.isSuccess()) {
entity = ShareMethod.getResponse(HttpStatus.OK, result.getMessage());
} else
entity = ShareMethod.getResponse(HttpStatus.NOT_MODIFIED, result.getMessage());
So that's for success code if the application successfully deletes from the database, is there any way to make this in BPEL?
Best Answer
-
Sorry, the editor got stuck some how...
I thought of something like
procedure delete_emps(p_status in varchar, p_cnt_deleted out number)isbegin delete from employees WHERE status = p_status; p_cnt_deleted := sql%rowcount;end;
(But then put in a package)
You can call this procedure using the database adapter.
Regards,
Martien
Answers
-
Hi,
I haven't done myself, but I believe it should be possible by using the Spring Service Component...
Have a look into the documentation...
Cheers,
Vlad
-
You could take a look here: https://blog.darwin-it.nl/2018/09/zipping-is-easy-in-javaspringsoasuite.html
I have done this several times in both 11g (where I sorted it out originally) and 12c.
Regards,
Martien -
hi thankyou for you answer, so i have to using Sping service component to be able create a validation for BPEL? never using it before, and thankyou for the further explanation sir @Martien van den Akker
could i use exception catch? for this situation?
-
Yes you should be able to catch exceptions. I think (though I never tried) you could define java exceptions and catch those specifically.
So if you want to use you java data access objects then this is the way to go, in my opinion. However, you could write a pretty straightforward pl/sql procedure that does the delete and checks how many rows are affected. See for instance: https://stackoverflow.com/questions/861983/number-of-rows-affected-by-an-update-in-pl-sql#862019
So you could do something like
procedure delete_emps(p_status in varchar, p_cnt_deleted out number)
is
begin
delete from
UPDATE employees
SET status = 'fired'
WHERE name like '%Bloggs';
i := sql%rowcount;
3741383 wrote:hi thankyou for you answer, so i have to using Sping service component to be able create a validation for BPEL? never using it before, and thankyou for the further explanation sir Martien van den Akker could i use exception catch? for this situation?
-
Sorry, the editor got stuck some how...
I thought of something like
procedure delete_emps(p_status in varchar, p_cnt_deleted out number)isbegin delete from employees WHERE status = p_status; p_cnt_deleted := sql%rowcount;end;
(But then put in a package)
You can call this procedure using the database adapter.
Regards,
Martien
-
thankyou sir this is the answer that i wanted