Skip to content

PreparedStatement#setBlob(int, InputStream) is not supported in DefaultLobCreator [SPR-12265] #16870

Closed

Description

@spring-projects-issues

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:

Activity

  1. spring-projects-issues commented on Sep 26, 2014

    @spring-projects-issues
    CollaboratorAuthor

    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

  2. spring-projects-issues commented on Sep 26, 2014

    @spring-projects-issues
    CollaboratorAuthor

    Kazuki Shimizu commented

    Thank you for quickly resolving :D !!

  3. spring-projects-issues commented on Sep 27, 2014

    @spring-projects-issues
    CollaboratorAuthor

    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 ?

  4. added
    in: data
    type: enhancement
    on Jan 11, 2019
  5. added this to the 4.1.1 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: datatype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions