In JDBC, why do parameter indexes for prepared statements begin at 1 instead of 0?

后端 未结 6 1685
暗喜
暗喜 2020-12-08 19:04

Everywhere else in Java, anything with an index starts at 0. Is there a reason for the change here or is this just bad design?

6条回答
  •  情话喂你
    2020-12-08 19:56

    This was part of a plot by the original language designers to weed out the weak. In the original spec, arrays were numbered from -1, and lists with 1 element returned length =0.

    Today, only the java Calendar API remains from this diabolical plot.

提交回复
热议问题