ADBA feedback
Mark Rotteveel
mark at lawinegevaar.nl
Fri Apr 27 14:13:07 UTC 2018
On 27-4-2018 16:10, Douglas Surber wrote:
> Where is ADBA 1-based? I don’t think there are any other places where it uses indexes at all.
I'm going by the example Lukas posted mentioning that "Row.get() is
still 1-based".
In any case, I think closer alignment to SQL and existing JDBC practices
might be more important, so my choice would be to go for 1-based.
Mark
>
>> On Apr 27, 2018, at 3:02 AM, Mark Rotteveel <mark at lawinegevaar.nl> wrote:
>>
>> On 26-4-2018 22:44, Douglas Surber wrote:
>>>> 6) Why is Row.rowNumber() zero based? That's very confusing. E.g. Row.get()
>>>> is still 1-based, and all SQL databases that support either ROWNUM or
>>>> ROW_NUMBER() OVER () functions will produce 1-based row numbers
>>> Because everything else in Java is zero based. If the consensus is to change this, that’s fine with me.
>>
>> Given JDBC is 1-based, the SQL standard is 1-based, and other parts of ADBA are also 1-based, I think following the principle of least surprise and use 1-based here as well would be a better choice.
>>
>> The only part where this runs afoul is things like `Result.getIdentifiers` returning a (0-based) array. Maybe add an explicit warning about it being 0-based there.
>>
>> The alternative would be to make the whole of ADBA 0-based, but that is likely more confusing for people used to JDBC and SQL 1-based behavior.
>>
>> Mark
>> --
>> Mark Rotteveel
>
--
Mark Rotteveel
More information about the jdbc-spec-discuss
mailing list