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 JDBC SqlValue classes for arrays [SPR-16904] #21443

spring-issuemaster opened this issue Jun 5, 2018 · 1 comment


Copy link

@spring-issuemaster spring-issuemaster commented Jun 5, 2018

Philippe Marschall opened SPR-16904 and commented

We are looking at converting some of our inlist usage to SQL arrays. We were a bit surprised that using arrays with JdbcTemplate requires implementing a custom SqlValue.

We propose introducing two classes.

  • An abstract base class that binds and frees the array but that leaves creating the array to a concrete subclass.
  • A concrete subclass that creates the array using Connection.createArrayOf(String, Object[])

The reason for this is that users might want to or may even have to use vendor extensions for creating arrays. We know of two such vendor extensions that might be interesting:

  • Oracle requires using a vendor method to create an array as Oracle does not support anonymous arrays.
  • PostgreS offers a vendor method for creating arrays from arrays of primitive arrays, therefore eliminating the need for boxing.

We do not propose to include subclasses for them.

Potentially, for convenience reasons java.util.Collection types could also be supported, for now we decided against this.

Affects: 5.0 GA

Referenced from: pull request #1850


This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jun 5, 2018

Philippe Marschall commented

Add PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.