Custom oracle exceptions via JDBC

In the stored procedure I'm used to:

raise_application_error (-20010, 'My Message');

      

to raise a custom error in a certain situation. What I am trying to do is when I make my JDBC call from java to be able to identify this error as not just a SQLException so that I can handle it differently. Although I could identify it using errorCode, it was always 17062 and not -20010.

Is there any other way to do this, or am I missing something?

+2


source to share


1 answer


you should get 20010 as yours errorCode

. ORA-17062

- bug for invalid ref cursors. Are you sure the procedure you are calling is throwing a custom error?



+2


source







All Articles