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#setBlob(int, InputStream) is not supported in DefaultLobCreator [SPR-12265] #16870

Closed
spring-projects-issues opened this issue Sep 26, 2014 · 3 comments
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Sep 26, 2014

Kazuki Shimizu opened SPR-12265 and commented

I hope that following methods will be supported in the DefaultLobCreator.
(methods that the data will be read from the stream as needed until end-of-file is reached.)

  1. PreparedStatement#setBlob(int, InputStream)
  2. PreparedStatement#setClob(int, Reader)
  3. PreparedStatement#setBinaryStream(int, InputStream)
  4. PreparedStatement#setAsciiStream(int, InputStream)
  5. PreparedStatement#setCharacterStream(int, Reader)

For example...
if contentLength is negative(-1), call method of without length.

How do think ?


Affects: 3.2.11, 4.0.7, 4.1 GA

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Good idea! As of 4.1.1, we're calling the JDBC 4.0 set-stream variants without a length parameter if the specified content length is negative.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Kazuki Shimizu commented

Thank you for quickly resolving :D !!

@spring-projects-issues
Copy link
Collaborator Author

Kazuki Shimizu commented

Might be better that there is a constant such as the following.

For example:

public interface LobCreator extends Closeable {
    int CONTENT_LENGTH_OF_EOF = -1;
    // ... (omitted)
}
public void setNonNullParameter(PreparedStatement ps, int i, InputStream parameter, JdbcType jdbcType) throws SQLException {
    lobHandler.getLobCreator().setBlobAsBinaryStream(ps,i,parameter,LobCreator.CONTENT_LENGTH_OF_EOF);
}

How do think ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants