Database trigger logic in Java?
I saw a post on the forum and fielded a question from my students on how you can write a database trigger that uses Java for the programming logic. I provided two approaches in this blog page. One lets Java raise the exception, which becomes an unhandled exception in SQL. The other implements the library as a function, and uses an IF statement to raise an exception – with RAISE_APPLICATION_ERROR
.
I’m partial to the second approach but think the Fusion middleware may yet present a better option in the future. You should take a peak at the oracle.dss.util.TypeNotSupportedException.