开发者

java (jdbc, ms sql server) how to get an indication that my query was executed?

开发者 https://www.devze.com 2023-03-05 16:04 出处:网络
My application does queries to database (non-que开发者_Python百科ries too). I show to the user indeterminate progressbar while transaction.

My application does queries to database (non-que开发者_Python百科ries too).

I show to the user indeterminate progressbar while transaction.

The problem is that I don't know when to close the progressbar, because I have no indication or signal object of query completion.


If your queries are taking so long that you need a progress bar, I'd recommend taking a hard look at your database to see how you can speed them up.

Since a database operation blocks, you know it's done when you return.

The progress bar suggests that you need some kind of polling mechanism to check a metric that indicates how much you have to do and how many have been done. Since you don't give any details, I can only guess what those might be.

But an AJAX call in your JSP to poll and update the progress bar is most likely what you need.

0

精彩评论

暂无评论...
验证码 换一张
取 消