java.sql2 indexed parameters
Douglas Surber
douglas.surber at oracle.com
Wed Oct 4 16:08:08 UTC 2017
Lukas,
Keep in mind that the async API is independent of the java.sql API. It is neither a replacement nor an extension. Any change in one has no impact on the other. So nothing in the async API implies anything about changes to java.sql.
I do not intend that the async API support indexed parameters. Adding support for indexed parameters adds a bunch of methods which are meaningless for most vendors. I strongly oppose the spec defining methods that a vendor could not implement without parsing the SQL. Vendors that do want to support indexed parameters, MySQL for example, can interpret the String arg as a decimal integer. For performance and type safety reasons such a vendor might also add set(int, …) methods as extensions.
To answer your questions, 1. indexed parameters are supported by vendors that choose to support them and 2. out of scope.
Douglas
> On Oct 4, 2017, at 1:55 AM, Lukas Eder <lukas.eder at gmail.com> wrote:
>
> Hello,
>
> I've noticed that parameters in the new java.sql2 API are all named
> parameters, not indexed parameters as in java.sql. This can be seen in:
>
> - ParameterizedOperation.set(String, ...) calls
> - OutOperation.outParameter(String, ...)
> - ParameterizedCountOperation.returning(String...)
>
> I'm assuming this means named parameters will (finally) be supported
> everywhere in the API. My questions:
>
> 1. Will indexed parameters be supported as well, e.g. to simplify migration?
> 2. Will named parameters be "backported" to the synchronous java.sql API
>
> Thanks,
> Lukas
More information about the jdbc-spec-discuss
mailing list