I have a Java application server connected to an oracle 11.2 database server using JDBC. A client request is sent to the application server, which runs the Java method, which calls the first stored procedure in the database.
I want the java method, after calling the stored procedure, to sit and wait for the signal from the database (the signal indicates that some result is ready to be extracted from the database).
To avoid querying the database, you can use DBMS_ALERT to inform the java method (or methods, since multiple instances can run, one instance for each unique user) that the result is ready to be retrieved, in which case the java method can continue to execute the rest of its code?
Can someone provide a simple example of using DBMS_ALERT in this scenario? That is, how to configure it in the database so that when a warning field is sent to the table (for example, to a specified value, for example, "done") a warning is sent, and how to configure the java method so that it can receive ( including how it processes this message to check its contents, for example if (received_message == 'done'), etc.)?
source
share