how to call procedure in database asynchronously from java 1.4 code?

1.6k Views Asked by At
2

There are 2 best solutions below

0
On BEST ANSWER

I'm not sure to get the question but calling a stored procedure involves using a CallableStatement. For the asynchronous part, and because you mentioned EJBs, the standard way would be to use JMS and a Message Driven Bean. But I'm a bit confused by the part where you mention Java 1.4 and EJB 3.0 (that requires Java 1.5). Maybe you should clarify that requirement. Sending JMS messages to a MDB 3.0 from a Java 1.4 client should be possible though.

0
On

If you don't find a way to handle this at database level, you can do it like you would do any asynchronous stuff:

thread = new Thread() {
    public void run() {
        // do your procedure call here
    }
};
thread.start();