Skip to content

jdbc: metadata: ParameterMetaData support #173

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

Open
nicktorwald opened this issue May 6, 2019 · 2 comments
Open

jdbc: metadata: ParameterMetaData support #173

nicktorwald opened this issue May 6, 2019 · 2 comments
Labels
blocked Not ready to be implemented jdbc

Comments

@nicktorwald
Copy link

The JDBC compliance requires java.sql.ParameterMetaData to be fully implemented.

This issue is about describing Inputs of a PreparedStatement Object and optionally of a CallableStatement.

The method PreparedStatement.getParameterMetaData returns a ParameterMetaData object describing the parameter markers that appear in the PreparedStatement object. Methods in the ParameterMetaData interface provide information about the number of parameters and their characteristics.

Example:

PreparedStatement pstmt = conn.prepareStatement(
    "SELECT * FROM BOOKLIST WHERE ISBN = ?"
);
ParameterMetaData pmd = pstmt.getParameterMetaData();
int colType = pmd.getParameterType(1);

See the API specification for more details.

@Totktonada
Copy link
Member

AFAIK, we cannot obtain such metainformation from Tarantool right now and it seems we have no ways to emulate this feature on the driver side. I'll move this to JDBC + transactions milestone and will try to elaborate whether we'll support such kind of metainfo in the future.

@nicktorwald Can you please investigate how this usually implemented by other vendors? Whether they allows to obtain parameters metainfo w/o actual operation performing? If no, whether the metainfo is available after an operation?

@Totktonada Totktonada added the blocked Not ready to be implemented label May 20, 2019
@Totktonada
Copy link
Member

Blocked on tarantool/tarantool#3292

nicktorwald added a commit that referenced this issue Dec 1, 2019
In addition to result set metadata it's possible to examine parameters
of PreparedStatement using getParameterMetaData() method. Because
Tarantool returns extra info related to query parameters as a result of
PREPARE operation, we can fill ParameterMetaData by available info.

However, the server sends always 'ANY' as a target parameter type for
parameters and the driver treats all of them as UNKNOWN type. Once the
server starts to send proper types (such as integer, string and so on)
the driver should parse it automatically (required to be tested in
future).

Follows on: #173
nicktorwald added a commit that referenced this issue Jan 20, 2020
In addition to result set metadata it's possible to examine parameters
of PreparedStatement using getParameterMetaData() method. Because
Tarantool returns extra info related to query parameters as a result of
PREPARE operation, we can fill ParameterMetaData by available info.

However, the server sends always 'ANY' as a target parameter type for
parameters and the driver treats all of them as UNKNOWN type. Once the
server starts to send proper types (such as integer, string and so on)
the driver should parse it automatically (required to be tested in
future).

Follows on: #173
nicktorwald added a commit that referenced this issue Jan 20, 2020
In addition to result set metadata it's possible to examine parameters
of PreparedStatement using getParameterMetaData() method. Because
Tarantool returns extra info related to query parameters as a result of
PREPARE operation, we can fill ParameterMetaData by available info.

However, the server sends always 'ANY' as a target parameter type for
parameters and the driver treats all of them as UNKNOWN type. Once the
server starts to send proper types (such as integer, string and so on)
the driver should parse it automatically (required to be tested in
future).

Follows on: #173
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Not ready to be implemented jdbc
Projects
None yet
Development

No branches or pull requests

2 participants