Driver version
All current, including 11.1.2. Discovered when using 9.2.1
SQL Server version
irrelevant
Client Operating System
Debian 11.4
JAVA/JVM version
11.0.15
Problem description
Calling a method with 10 parameters. Getting this error when setting the 8th.
com.microsoft.sqlserver.jdbc.SQLServerException: The index 11 is out of range.
I've located the problem occurs when a method calls findColumn(parameterName) multiple times.
the problem is inside private int findColumn(String columnName)
map.putIfAbsent(columnName, ai.incrementAndGet());
return map.get(columnName);// attempting to look up the first column will return no access exception
The ai.incrementAndGet() is called even though the parameter is already present.
This is fine if there are no more parameters after it, but there are this time.
suggested correction:
return map.computeIfAbsent(columnName, ignored -> ai.incrementAndGet());
Driver version
All current, including 11.1.2. Discovered when using 9.2.1
SQL Server version
irrelevant
Client Operating System
Debian 11.4
JAVA/JVM version
11.0.15
Problem description
Calling a method with 10 parameters. Getting this error when setting the 8th.
I've located the problem occurs when a method calls
findColumn(parameterName)multiple times.the problem is inside
private int findColumn(String columnName)The
ai.incrementAndGet()is called even though the parameter is already present.This is fine if there are no more parameters after it, but there are this time.
suggested correction: