This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Servlets and PL\SQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlets and PL\SQL" Watch "Servlets and PL\SQL" New topic

Servlets and PL\SQL

O. Ziggy
Ranch Hand

Joined: Oct 02, 2005
Posts: 430

Hi guys,

I've got the following code that calls a stored procedure from a web based servlet application.

The above statement calls a PL\SQL stored procedure in the database. The stored procedure takes about 2 hrs to complete.

When my servlet calls this procedure, the relevant webpage on the front end is showing that its waiting for the stored procedure to return something.

How can i call the stored procedure and have it run in the background while the servlet returns e.g. a message saying that the stored procedure is running in the background.

I just need an idea or references as to how i can do this. Does the servlet have to call the PL\SQL in another thread? Is there something in CallableStatement that i can use to tell the servlet not to wait for a response from the PL\sqL?

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

If it takes 2 hours, I would make the call in a new thread and email the user when it's done.

If you want simple example of a webapp that starts a long running process in a new thread see:
Look for LongRunningProcess.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Servlets and PL\SQL
It's not a secret anymore!