play.libs.concurrent.HttpExecutionContext is just a wrapper for an Executor with a .current() method. It can wrap any executor, for example:
HttpExecutionContext dbHttpExecutor = new HttpExecutionContext(dbExecutor);
Note that injecting a HttpExecutionContext by default uses Play's default executor. If you want to be able to inject your custom HttpExecutionContext you should use a subclass or binding annotation.
Then it can be used like:
CompletableFuture.supplyAsync({ /* some code */ }, dbHttpExecutor.current());
When I call dbHttpExecutor.current(), The HttpExecutionContext helper reads the Http.Context.current() from the current thread and creates an Executor that, for every Runnable executed, it sets the Http.Context at the start of execution and unsets it at the end. Otherwise it behaves just like the wrapped Executor.
All that said, usually you want to separate your database repositories from code that accesses/modifies request information. If you need to access session info, it's probably better to get that info and pass it to a method that makes the database queries.