简体   繁体   中英

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

My application does queries to database (non-queries 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM