You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clickhouse jdbc-v2: Prepared Statement not working when column names like "ip" or "url" appear in query #2617
If the query contains column names like "ip" or "url" then PreparedStatement 's setObject() or any set methods throw java.lang.ArrayIndexOutOfBoundException
Steps to reproduce
Create a simple table in clickhouse CREATE TABLE myusers ( id UInt64, ip String, url String, tenant String) ENGINE = MergeTree() PRIMARY KEY (id);
Write a simple query "select ip from myusers where tenant=?" in java code
Use connection.prepareStatement(query) to generate PreparedStatement object
Call setObject(1,1) on prepare statement object
same observed for url
Error Log or Exception StackTrace
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at com.clickhouse.jdbc.PreparedStatementImpl.setObject(PreparedStatementImpl.java:291)
Expected Behaviour
It should allow setting objects in PreparedStatement without exception
Code Example
Stringquery = "select ip from myusers where tenant=?";
PreparedStatementps = connection.prepareStatement(query);
ps.setObject(1, 1);
changed the title [-]Clickhouse JDBC Prepared Statement not working when column names like "ip" or "url" are contained in query[/-][+]Clickhouse JDBC Prepared Statement not working when column names like "ip" or "url" appear in query[/+]on Oct 17, 2025
changed the title [-]Clickhouse JDBC Prepared Statement not working when column names like "ip" or "url" appear in query[/-][+]Clickhouse JDBC v2 : Prepared Statement not working when column names like "ip" or "url" appear in query[/+]on Oct 17, 2025
changed the title [-]Clickhouse JDBC v2 : Prepared Statement not working when column names like "ip" or "url" appear in query[/-][+]Clickhouse jdbc-v2: Prepared Statement not working when column names like "ip" or "url" appear in query[/+]on Oct 17, 2025
Activity
[-]Clickhouse JDBC Prepared Statement not working when column names like "ip" or "url" are contained in query[/-][+]Clickhouse JDBC Prepared Statement not working when column names like "ip" or "url" appear in query[/+][-]Clickhouse JDBC Prepared Statement not working when column names like "ip" or "url" appear in query[/-][+]Clickhouse JDBC v2 : Prepared Statement not working when column names like "ip" or "url" appear in query[/+][-]Clickhouse JDBC v2 : Prepared Statement not working when column names like "ip" or "url" appear in query[/-][+]Clickhouse jdbc-v2: Prepared Statement not working when column names like "ip" or "url" appear in query[/+]chernser commentedon Oct 20, 2025
Good day, @adityam31 !
Thank you for reporting!
We will fix it!