Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PreparedStatement#getMetaData executes query #387

Closed
olavloite opened this issue Mar 10, 2021 · 0 comments · Fixed by #388
Closed

PreparedStatement#getMetaData executes query #387

olavloite opened this issue Mar 10, 2021 · 0 comments · Fixed by #388
Assignees
Labels
api: spanner Issues related to the googleapis/java-spanner-jdbc API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@olavloite
Copy link
Collaborator

Calling PreparedStatement.getMetaData() will execute the query of the PreparedStatement. That is both inefficient and does not work if the prepared statement has unbound parameters. Executing the query in PLAN mode is enough to retrieve the metadata, and also works if there are unbound parameters.

@olavloite olavloite added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: spanner Issues related to the googleapis/java-spanner-jdbc API. labels Mar 10, 2021
@olavloite olavloite self-assigned this Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner-jdbc API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant