Java desktop - how to separate database access from the UI thread?
I have recently used Quartz scheduler for running some background processes (eg. report generation) that involves database access. Now, this background tasks runs in separate threads. However, the database access in done in a central point in my application, and something like

    System.err.println("CURRENT THREAD: "+ Thread.currentThread().getName());

prints "main", before executing the actual query. Therefore, i am thinking that the database read is done by the UI thread ("main" thread). This is also confirmed by the fact that the UI loses (in part) his responsiveness. What i want to do, if possible, is to run every database access in a separate thread, so that a Cancel button can be implemented to a query request, if that will become necessary. So, i imagine having this workers:

 - UI thread: responsible for UI;
 - Database access thread: responsible for data retrieving from the db;
 - Scheduled background tasks: responsible for everything else (and using the DB access thread).

 Can this be realized? Or, is there a better alternative to my approach?

P.S. I do not want to use at this point some existing frameworks, that address this issue (Hibernate, Spring, etc). I just need a home-brew, working solution.
Java desktop - how to separate database access from the UI thread?
===

I have recently used Quartz scheduler for running some background processes (eg. report generation) that involves database access. Now, this background tasks runs in separate threads. However, the database access in done in a central point in my application, and something like

    System.err.println("CURRENT THREAD: "+ Thread.currentThread().getName());

prints "main", before executing the actual query. Therefore, i am thinking that the database read is done by the UI thread ("main" thread). This is also confirmed by the fact that the UI loses (in part) his responsiveness. What i want to do, if possible, is to run every database access in a separate thread, so that a Cancel button can be implemented to a query request, if that will become necessary. So, i imagine having this workers:

 - UI thread: responsible for UI;
 - Database access thread: responsible for data retrieving from the db;
 - Scheduled background tasks: responsible for everything else (and using the DB access thread).

 Can this be realized? Or, is there a better alternative to my approach?

P.S. I do not want to use at this point some existing frameworks, that address this issue (Hibernate, Spring, etc). I just need a home-brew, working solution.