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

Add support for typeName in registerOutParameter #2556

Open
thomasdewaelheyns opened this issue Dec 7, 2023 · 4 comments
Open

Add support for typeName in registerOutParameter #2556

thomasdewaelheyns opened this issue Dec 7, 2023 · 4 comments
Labels
not a bug on hold waiting-for-op Waiting for a response from the original poster WIP

Comments

@thomasdewaelheyns
Copy link

In the current implementation, the OutParamArgument class inside the Call class only supports
registerOutParameter(int parameterIndex, int sqlType) throws SQLException.

For some sqlTypes, such as arrays in Oracle,
registerOutParameter (int parameterIndex, int sqlType, String typeName) throws SQLException;
should be used with a typeName: the fully-qualified name of an SQL structured type.

At the moment, there is no way to add support from outside of JDBI because the necessary classes are private, package private, or final.
Would it be possible to extend Call and OutParamArgument?

@thomasdewaelheyns
Copy link
Author

thomasdewaelheyns commented Dec 7, 2023

I implemented the required changes myself to test this solution Issue2556. If the project is open to it I could open a pull request.

@hgschmie
Copy link
Contributor

Hello @thomasdewaelheyns,

Thank you for opening an issue with the Jdbi project. Yes, we very much welcome contributions to the code base. Please review the https://github.com/jdbi/jdbi/blob/master/CONTRIBUTING.md document. For a change like this, an unit test would be great.

We have a number of procedure/outparameter related tests in TestCallable in the core module and in TestOutParameterAnnotation and TestPostgresRefcursorProc which should help you to see the structure of such a test.

We can run tests in the main code base with postgres, h2 and sqlite; we have very limited test support for other databases. If this is a test that needs to be validated with oracle specifically, the test would need to go into the https://github.com/jdbi/jdbi3-oracle12; in that case, please open a separate PR for that repository that contains the test.

@hgschmie hgschmie added on hold WIP not a bug waiting-for-op Waiting for a response from the original poster labels Jan 3, 2024
@hgschmie
Copy link
Contributor

I am happy to review and take a PR, otherwise you will have to wait until I get around to do some work with the Oracle code again.

@hgschmie
Copy link
Contributor

@thomasdewaelheyns will you find time to work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug on hold waiting-for-op Waiting for a response from the original poster WIP
Development

No branches or pull requests

2 participants