Repository navigation
[Java][FlightRPC] Flight SQL JDBC driver parameter getting an exception: parameter ordinal 1 out of range #121
Description
Activity
Duplicate of apache/arrow#33475
This was fixed in 15.0.0, can you upgrade and try again?
Duplicate of apache/arrow#33475
This was fixed in 15.0.0, can you upgrade and try again?
Have tried it with 15.0.0 and it's has the same issue
Can you post all the details with 15.0.0 (stack trace, versions, etc)?
Can you post all the details with 15.0.0 (stack trace, versions, etc)?
Sir, the error is still the same and the code is exactly the same, if you want I can repaste in here again , including the exception details. I can even add the project it self if needed. Which I will do.
anybase-inspector-probe.zipI'm just asking for the stack trace, so I can take a quick look. While the project is appreciated, I don't have the time to build this from scratch.
Error executing SQL: parameter ordinal 1 out of range java.sql.SQLException: parameter ordinal 1 out of range at cfjd.org.apache.calcite.avatica.Helper.createException(Helper.java:60) at cfjd.org.apache.calcite.avatica.AvaticaPreparedStatement.getParameter(AvaticaPreparedStatement.java:427) at cfjd.org.apache.calcite.avatica.AvaticaPreparedStatement.getSite(AvaticaPreparedStatement.java:434) at cfjd.org.apache.calcite.avatica.AvaticaPreparedStatement.setInt(AvaticaPreparedStatement.java:174) at com.ge.core.SQLInterpreterWithParameters.setParameter(SQLInterpreterWithParameters.java:62) at com.ge.core.SQLInterpreterWithParameters.handleSqlStatements(SQLInterpreterWithParameters.java:38) at com.ge.grid.Main.main(Main.java:11)Is the server implementation actually returning a parameter schema?
Is the server implementation actually returning a parameter schema?
all the column names are back other than that IDK, can you point me where to look please?
What server implementation are you using? It needs to fill in the parameter_schema in the CreatePreparedStatement response https://github.com/apache/arrow/blob/a03d957b5b8d0425f9d5b6c98b6ee1efa56a1248/format/FlightSql.proto#L1524-L1549
parameter_schema
Seems like it's empty: The calcite oriented db
var preparedStatementResult = new ActionCreatePreparedStatementResult { DatasetSchema = schema.ToByteString(), ParameterSchema = ByteString.Empty,
The server needs to return the schema so that the driver knows how many and what type the parameters are. We could perhaps improve the error message on the client, or assume what the type/number of parameters are based on what the client does, but that is a duplicate of #156
Reacted by HackP0!ntThe server needs to return the schema so that the driver knows how many and what type the parameters are. We could perhaps improve the error message on the client, or assume what the type/number of parameters are based on what the client does, but that is a duplicate of #156
I understand and already opened an issue in our code base, really appreciate you assistance. Awesome responsiveness.
Sounds good. I'll leave this open and link it in that issue to track the error message improvement.
Reacted by Eyal EzerI encountered the same problem
the version 15.0.0- marked flight-sql-jdbc-driver throws "parameter ordinal 1 out of range" for PreparedStatement in SELECT query #1009 as a duplicate of this issue
on Feb 23, 2026
Describe the bug, including details regarding any error messages, version, and platform.
Getting this exception
My code:
Component(s)
Java