java.sql2 minor feature request

Douglas Surber douglas.surber at oracle.com
Wed Oct 18 17:01:24 UTC 2017


Lukas,

I think you have answered your own question. I can see the benefit of what you describe for non-Java folks. But this is a Java standard so it is not sufficiently important to be in the first release. That’s not to say it couldn’t be considered for a subsequent release.

Douglas

> On Oct 18, 2017, at 1:28 AM, Lukas Eder <lukas.eder at gmail.com> wrote:
> 
> Hello,
> 
> In my previous email [1], I was discussing potential annotation
> enhancements. While I am personally not a big fan of annotations, I do
> appreciate how they make client code more concise. One nice feature that is
> derived from @SqlColumns is the fact that we can fetch the entire
> Result.Row into a POJO in one go.
> 
> Now, POJOs are one way to get an entire row from a result set. Another one
> would be an Object[] or List<Object> type (or a tuple, if Java had them).
> This is the preferred approach for people who do not embrace nominal typing
> as much as the OO folks in Java land do, specifically people who work in
> more functional programming paradigms. In those cases, it would be really
> cool if there was a method
> 
> Object[] Result.ResultMap.get()
> 
> ... which would simply yield the entire Row contents. The Object[] type
> seems well aligned with the String[] type returned from getIdentifiers(). I
> would imagine this approach to be much cheaper than the alternative of
> iterating the identifiers and then fetching them 1-by-1. That's something
> that has been really missing in the classic JDBC API as well.
> 
> What do you think?
> Lukas
> 
> [1]:
> http://mail.openjdk.java.net/pipermail/jdbc-spec-discuss/2017-October/000186.html



More information about the jdbc-spec-discuss mailing list