BoundStatement indexed getXXX and setXXX method Javadocs should explicitly state that indexes are zero-based

4 views
Skip to the first unread message

Kelly Denehy

unread,
5 Oct 2017, 14:44:5905/10/2017
to DataStax Java Driver for Apache Cassandra User Mailing List
Gotta get this rant off my chest.

As much as I dislike that the JDBC developers decided to make the indexing for PreparedStatements 1-based (as shown in the Javadocs below), I wish that BoundStatement used the same convention. That would have saved me about 4 wasted hours.  

In lieu of that, I at least wish all of the Cassandra documentation and Javadocs made that a lot clearer. For an API that feels a lot like JDBC to use a different convention like this was an unexpected and unwelcome surprise.

setString

void setString(int parameterIndex,
             String x)
               throws SQLException
Sets the designated parameter to the given Java String value. The driver converts this to an SQL VARCHAR or LONGVARCHAR value (depending on the argument's size relative to the driver's limits on VARCHAR values) when it sends it to the database.
Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
x - the parameter value

Reply all
Reply to author
Forward
0 new messages