Home » Developer & Programmer » JDeveloper, Java & XML » Creating a SQL-query Progress-Bar
Creating a SQL-query Progress-Bar [message #111673] Fri, 18 March 2005 09:55 Go to next message
cosmo
Messages: 2
Registered: March 2005
Junior Member
Hi guys,

In my program (which runs on oracle 9i) I perform some very heavy queries (which might take up to 10 minutes or so).

The user has the ability to cancel a query, using the Statement.cancel() method.

I would like to add a progress bar which will help the user make up his mind whether to cancel the query or not.

After doing some research I found out that the answer is probably in v$session_longops.

But I didn't understand how am I supposed to do it.
Does anyone here has a code snippet which does something similar?
I would really appreciate any help in this matter.
Re: Creating a SQL-query Progress-Bar [message #111718 is a reply to message #111673] Fri, 18 March 2005 15:28 Go to previous message
Frank Naude
Messages: 4579
Registered: April 1998
Senior Member
Hi,

You need to implement a Java progres bar and update it with data selected from v$session_longops:

//Where member variables are declared:
JProgressBar progressBar;
...
//Where the GUI is constructed:
progressBar = new JProgressBar(0, task.getLengthOfTask());
progressBar.setValue(0);
progressBar.setStringPainted(true);
...
// Loop to select from v$session_longops and update progress
progressBar.setValue(task.getCurrent());


More examples at http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html

Best regards.

Frank
Previous Topic: Preparedstatement and ORDER BY issue
Next Topic: converting mysql functions to oracle; using java language
Goto Forum:
  


Current Time: Fri Apr 26 15:41:34 CDT 2024