In my application, I have a frequent, but a very long-running query to the database (PostgreSQL).
So I want to execute my query in an async way. I haven't found how this could be done via JDBC. Is it possible?
Printable View
In my application, I have a frequent, but a very long-running query to the database (PostgreSQL).
So I want to execute my query in an async way. I haven't found how this could be done via JDBC. Is it possible?
I've heard about some async drivers (https://github.com/mauricio/postgresql-async), though:
a) they're not jdbc-compatible
b) I have no experience in it.
Anyway, I think the solution could be more simplified. You just create another thread, that would run the query and get the data from the database. After the result is ready, you could show it in your main app thread.
Also, if you have difficulties with this you can contact https://www.issart.com/en/. These guys participated in the creation of alternative JDBC driver (
https://www.issart.com/en/portfolio/details/id/144), so they may help you.