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
Executing a PreparedStatement after creating a secret (or after reading the secrets) fails with Binder Error: Parameter/argument count mismatch for prepared statement. Expected 0, got 1 #294
@TestpublicvoidsetVariable_v3() throwsSQLException {
// this failsConnectionconn = DriverManager.getConnection("jdbc:duckdb:");
conn.createStatement().execute("CREATE or replace PERSISTENT SECRET (TYPE postgres, HOST 'localhost', database 'anything', user 'anyone', password 'youchoose')");
PreparedStatementpreparedStatement = conn.prepareStatement("set variable my_var = ?");
preparedStatement.setString(1, "my value");
preparedStatement.execute();
}
with:
java.sql.SQLException: Binder Error: Parameter/argument count mismatch for prepared statement. Expected 0, got 1
at org.duckdb.DuckDBNative.duckdb_jdbc_execute(Native Method)
at org.duckdb.DuckDBPreparedStatement.execute(DuckDBPreparedStatement.java:193)
at org.duckdb.DuckDBPreparedStatement.execute(DuckDBPreparedStatement.java:159)
at eu.bosteels.DuckDbTest.setVariable_v3(DuckDbTest.java:137)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
Reading the secrets also causes the preparedStatement.execute() to fail: