forcedotcom / forcedotcom/Salesforce-CDP-jdbc
Indexes of parameters for prepared statements must be 1-based.
- Dominant language
- Java
- Stars
- 41
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
Method createSqlQuery in a QueryServicePreparedStatement class use 0-based indexes for prepared statements. But historically java uses 1-based indexes for prepared statements See examples and javadoc here: https://docs.oracle.com/en/java/javase/13/docs/api/java.sql/java/sql/PreparedStatement.html#setByte(int,byte)
Because of this issue all arguments are shifted and 1st argument is replaced by "null" value. Below you can see a screenshot of logs for project with iBatis framework:

Contributor guide
No contributing guide indexed for this repository
Research direction
Locate the QueryServicePreparedStatement class and inspect its createSqlQuery method, focusing on how parameter indexes are assigned for prepared statements. Verify the change against the Java PreparedStatement documentation and confirm that the first argument is preserved rather than replaced with null and that subsequent arguments are not shifted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100