Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexes of parameters for prepared statements must be 1-based. #117

Open
kool79 opened this issue Jan 24, 2023 · 1 comment
Open

Indexes of parameters for prepared statements must be 1-based. #117

kool79 opened this issue Jan 24, 2023 · 1 comment

Comments

@kool79
Copy link

kool79 commented Jan 24, 2023

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:
scr_2023_01_24T20_41_43

kool79 added a commit to kool79/Salesforce-CDP-jdbc that referenced this issue Jan 24, 2023
kool79 added a commit to kool79/Salesforce-CDP-jdbc that referenced this issue Jan 24, 2023
@kool79
Copy link
Author

kool79 commented Feb 7, 2023

This fix required to use this driver with another DB libraries which use PreparedStatements. For example, with MyBatis/iBatis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant