java.sql2 indexed parameters
Lance Andersen
Lance.Andersen at oracle.com
Wed Oct 4 16:19:50 UTC 2017
We had discussed early on about whether or not indexed parameters were needed and the decision was they are not.
The discussion of true named parameters has come up multiple times in the JDBC EG and there was not broad support from the driver vendors at the time for its inclusion so it has never been a priority.
Best
Lance
On Oct 4, 2017, at 12:08 PM, Douglas Surber <douglas.surber at oracle.com> wrote:
> 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
>
Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
Lance.Andersen at oracle.com
More information about the jdbc-spec-discuss
mailing list