开发者

Separate thread for SQL DB Queries

I am writing an application 开发者_StackOverflow社区which will have to regularly poll an SQL Database to get the latest entries. These entries will be translated into Java Objects and passed to the GUI which will then represent them graphically.

I have a DatabaseManager class which will query the DB as needed, but these methods don't return until after the query and translation are complete. This causes the GUI to hang immensely.

I would like to set this up to run the SQL queries in a separate thread. Could you offer any guidance?


See http://java.sun.com/developer/technicalArticles/javase/swingworker/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜