java.sql2 usage examples

Lukas Eder lukas.eder at
Wed Oct 4 08:45:59 UTC 2017


We've been in touch briefly on Twitter after Bruno Borges has announced the
current status quo of your work on the java.sql2 package / module:

I'm very happy to see that this is being worked on, and specifically, that
it will be integrated with the new JDK 9 Flow API.

I'm intrigued by the suggested API design which models everything as an
Operation. However, from the API itself, it is not trivial to deduce how it
should be used. Specifically, the <S, T> types in OperationGroup<S, T> do
not seem to be clear to me. When obtaining such an OperationGroup<S, T>
reference through Connection.operationGroup(), the API user is completely
free to bind any type to the type variables, which seems surprising, given
that the types are erased and the implementation cannot guess what the
caller's intentions were. Do you have some examples about how to use this,

- A typical example for calling OperationGroup.rowOperation()
- What the idea behind the various initialValue(Supplier<T>) methods is
- An example of how to use DynamicMultiOperation<T>. I'm assuming this is
for calling procedures that produce a mixture of row counts / result sets /
exceptions as is done sometimes in MySQL / SQL Server

I have more questions about some details, which I'll ask in separate emails

Lukas (from the jOOQ team)

More information about the jdbc-spec-discuss mailing list