简体   繁体   English

java(jdbc,ms sql服务器)如​​何获取指示我的查询已执行?

[英]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. 但是,最有可能需要在JSP中进行AJAX调用以轮询和更新进度栏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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