5

Since working with databases requires input/output, may take unbounded amount of time, etc. it seems natural to want a non-blocking, asynchronous API. Is there one for Java?

0

3 Answers 3

4

I do not think that such API exists but there are 2 different things: DB access libraries and a lot of ways to perform asynchronous calls in java.

  • You can use either plain JDBC or any other higher level tool that simplifies DB access implementation to access your database.

  • You can make asynchronous calls using JMS (if you are in Java EE environment) or using queues and executors from concurrency package if your are in JSE environment. Obviously a lot of other solutions available too.

Sign up to request clarification or add additional context in comments.

Comments

3

There is no standard API like JBDC which would allow you to asynchronously call any DB. However there is this Google Project which tries to do exactly this for PostgreSQL and MySQL.

You may also take a look at this question, which addresses similar stuff:

Is asynchronous jdbc call possible?

Comments

1

For Couchbase I came across Reactive Couchbase which claims to do this and has a Java Wrapper. Didn't try it but there are several examples in the links.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.