Title: flight-sql-jdbc-driver throws "parameter ordinal 1 out of range" for PreparedStatement in SELECT query · Issue #1009 · apache/arrow-java · GitHub
Open Graph Title: flight-sql-jdbc-driver throws "parameter ordinal 1 out of range" for PreparedStatement in SELECT query · Issue #1009 · apache/arrow-java
X Title: flight-sql-jdbc-driver throws "parameter ordinal 1 out of range" for PreparedStatement in SELECT query · Issue #1009 · apache/arrow-java
Description: Describe the usage question you have. Please include as many useful details as possible. I am using the flight-sql-jdbc-driver (version 18.x / Doris 3.x) and I am trying to execute a simple SELECT query with a PreparedStatement and a ? p...
Open Graph Description: Describe the usage question you have. Please include as many useful details as possible. I am using the flight-sql-jdbc-driver (version 18.x / Doris 3.x) and I am trying to execute a simple SELECT ...
X Description: Describe the usage question you have. Please include as many useful details as possible. I am using the flight-sql-jdbc-driver (version 18.x / Doris 3.x) and I am trying to execute a simple SELECT ...
Opengraph URL: https://github.com/apache/arrow-java/issues/1009
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"flight-sql-jdbc-driver throws \"parameter ordinal 1 out of range\" for PreparedStatement in SELECT query","articleBody":"### Describe the usage question you have. Please include as many useful details as possible.\n\n\nI am using the flight-sql-jdbc-driver (version 18.x / Doris 3.x) and I am trying to execute a simple SELECT query with a PreparedStatement and a ? placeholder. However, I consistently get the following exception: \n\njava.sql.SQLException: parameter ordinal 1 out of range\n\nHere is the minimal example of the code : \n\nimport java.sql.*;\n\n public class DorisTest \n {\n public static void main(String[] args) throws Exception {\n // Connect to Doris Flight SQL\n String url = \"jdbc:apache:arrow:flight://host:port\";\n Connection conn = DriverManager.getConnection(url);\n\n // SQL with a single parameter\n String sql = \"SELECT * FROM Connectors WHERE connectorID = ?\";\n PreparedStatement ps = conn.prepareStatement(sql);\n ps.setInt(1, 1); // This line throws SQLException\n\n ResultSet rs = ps.executeQuery();\n while (rs.next()) {\n System.out.println(rs.getInt(\"connectorID\"));\n }\n\n conn.close();\n }\n }\n\nThe driver throws: java.sql.SQLException: parameter ordinal 1 out of range\n\nAdditional observations:\n1. PreparedStatement is obtained directly from the JDBC connection.\n2. PreparedStatement.getParameterMetaData() seems to return 0 parameters.\n3. The driver works fine for queries without placeholders or with inline values.\n4. The Flight SQL JDBC driver appears to not support ? placeholders reliably in this version.\n\nQuestion:\n1. Is this a known limitation of the Doris Flight SQL JDBC driver?\n2. Are there any workarounds to use PreparedStatement with parameters for SELECT queries?\n3. If placeholders are not supported, what is the recommended way to safely execute parameterized queries (especially for IN clauses with multiple \n values) in Doris Flight SQL JDBC driver?\n\nAny guidance or best practices would be greatly appreciated!\n","author":{"url":"https://github.com/eqrvivek","@type":"Person","name":"eqrvivek"},"datePublished":"2026-02-06T06:05:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/1009/arrow-java/issues/1009"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ecf2f1f6-e63b-c264-83c8-f44716861c48 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B792:26836F:DC8F97:11CA7E8:699238C3 |
| html-safe-nonce | 17ffaaf89f3f03261e24d61a4ce580b215c8fad42c698ea8a2f11247d89b4db5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzkyOjI2ODM2RjpEQzhGOTc6MTFDQTdFODo2OTkyMzhDMyIsInZpc2l0b3JfaWQiOiI0NDA0NzIyODY3NzM4MTMwNjI3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0e20d6c677c453ecb5e0a09c3fbcb04345ffc01d6fa9203fd6e3a9efe6b249e1 |
| hovercard-subject-tag | issue:3905096563 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/arrow-java/1009/issue_layout |
| twitter:image | https://opengraph.githubassets.com/99cb083aa3c2140d703dcf1690627be08a23db11e09b39f0ef112b45b105cb38/apache/arrow-java/issues/1009 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/99cb083aa3c2140d703dcf1690627be08a23db11e09b39f0ef112b45b105cb38/apache/arrow-java/issues/1009 |
| og:image:alt | Describe the usage question you have. Please include as many useful details as possible. I am using the flight-sql-jdbc-driver (version 18.x / Doris 3.x) and I am trying to execute a simple SELECT ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | eqrvivek |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/apache/arrow-java git https://github.com/apache/arrow-java.git |
| octolytics-dimension-user_id | 47359 |
| octolytics-dimension-user_login | apache |
| octolytics-dimension-repository_id | 893682219 |
| octolytics-dimension-repository_nwo | apache/arrow-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 893682219 |
| octolytics-dimension-repository_network_root_nwo | apache/arrow-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width