You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "Istvan Toth (Jira)" <ji...@apache.org> on 2022/03/11 09:25:00 UTC
[jira] [Commented] (PHOENIX-6665) PreparedStatement#getMetaData() fails on parematrized "select next ? values for SEQ"
[ https://issues.apache.org/jira/browse/PHOENIX-6665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17504824#comment-17504824 ]
Istvan Toth commented on PHOENIX-6665:
--------------------------------------
Avatica uses this for every preparedQuery.
Consequently, the above query fails via PQS, even without explicitly calling nextStmt.getMetaData().
> PreparedStatement#getMetaData() fails on parematrized "select next ? values for SEQ"
> -------------------------------------------------------------------------------------
>
> Key: PHOENIX-6665
> URL: https://issues.apache.org/jira/browse/PHOENIX-6665
> Project: Phoenix
> Issue Type: Bug
> Components: core
> Affects Versions: 5.2.0
> Reporter: Istvan Toth
> Priority: Major
>
>
> {code:java}
> PreparedStatement nextStmt = conn.prepareStatement("SELECT NEXT ? VALUES FOR SEQ_TABLE");
> nextStmt.getMetaData();{code}
> Fails.
> According to the PreparedStatement javadoc, this should work:
> {quote}
> Because a {{PreparedStatement}} object is precompiled, it is possible to know about the {{ResultSet}} object that it will return without having to execute it. Consequently, it is possible to invoke the method {{getMetaData}} on a {{PreparedStatement}} object rather than waiting to execute it and then invoking the {{ResultSet.getMetaData}} method on the {{ResultSet}} object that is returned.
> {quote}
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)