cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Need an example for a progress bar

Former Member
0 Likes
585

Hello,

One of the DynPro UI's is a progress bar.

I have a certain view which loads a ResultSet from a certain DB. This ResultSet is being loaded to the view in a while(rs.next()) loop and since it contains huge amount of records it takes it few minutes to load.

Can someone please show me an example of how can integrate such a progress bar in the view which will display the amount of time left for loading?

View Entire Topic
Former Member
0 Likes

Hi,

There wont be a direct way to get it.. You can get the system time before and after the execution of the query and play with it.. For every pass through while(rs.next()).. u can get the system time,subtract it from initial time and set the bar percentage value proportionally...It will simulate a progress bar like scenario....

System time can be obtained by System.currentTimeMillis().

regards

Bharathwaj

Former Member
0 Likes

hello Bharathwaj

but i think rs.next() will execute only after the whole resultset is loaded. also after every rs.next() u need to refresh the page. that will take a lot of time to show the result page.

regards,

Piyush.

Former Member
0 Likes

Hey Bharathwaj,

But how can I know in advance the system time after the execution...?

Former Member
0 Likes

hello Roy,

let me give u an example:

long startTime = System.currentTimeMillis(); //line1

rs = pr.excuteQuery(); // line2

long stopTime = System.currentTimeMillis(); // line3

now u ll get the stopTime only after the the execution of line2 is complete, ie all the resultset is loaded. so now there is not use of the progress bar.

regards,

Piyush.