Peaches491
Peaches491

Reputation: 1239

Separate thread for SQL DB Queries

I am writing an application 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?

Upvotes: 0

Views: 439

Answers (1)

Related Questions