Time taken for a method to run. ?
I have a query regarding ascertaining the time taken
for a method to execute
I have a SQL statement that I reads 10,000 rows.
String a_SQL ="Select.....from TableA";
try{
IQuery query = m_UC.createQuery();
SimpleTableModel stm = query.executeSelect(a_SQL);
}catch(SQLException se){
}
// Query Over.
privatevoid displayJTable(){
// display rows read from the query above.
}
As the query is executing,I want to display a progress bar
showing the status of the query.
Now I cant use this :
start = System.currentTimeMillis();
try{
IQuery query = m_UC.createQuery();
SimpleTableModel stm = query.executeSelect(a_SQL);
}catch(SQLException se){
}
end = System.currentTimeMillis();
System.out.println(" Time taken to display " + (end - start)/1000);
The above will give me the time elapsed in seconds for the SQL query to execute,but
this is not what I want.
What i want is to use this :
// Progress BAR executing,so I need to get to know the time
// taken for the query to run
try{
the SQL execution
}cach(){
}
// Query over.
// Stop Progres Bar.
// Display JTable.
How can I know when to stop the Progress Bar as I have no handle
on the time taken to execute the query?
Any help will be appreciated

