类 DefaultLobHandler

    • 字段详细资料

    • 方法详细资料

      • setWrapAsLob

        public void setWrapAsLob​(boolean wrapAsLob)
        Specify whether to submit a byte array / String to the JDBC driver wrapped in a JDBC Blob / Clob object, using the JDBC setBlob / setClob method with a Blob / Clob argument.

        Default is "false", using the common JDBC 2.0 setBinaryStream / setCharacterStream method for setting the content. Switch this to "true" for explicit Blob / Clob wrapping against JDBC drivers that are known to require such wrapping (e.g. PostgreSQL's for access to OID columns, whereas BYTEA columns need to be accessed the standard way).

        This setting affects byte array / String arguments as well as stream arguments, unless "streamAsLob" overrides this handling to use JDBC 4.0's new explicit streaming support (if available).

        另请参阅:
        PreparedStatement.setBlob(int, java.sql.Blob), PreparedStatement.setClob(int, java.sql.Clob)
      • setStreamAsLob

        public void setStreamAsLob​(boolean streamAsLob)
        Specify whether to submit a binary stream / character stream to the JDBC driver as explicit LOB content, using the JDBC 4.0 setBlob / setClob method with a stream argument.

        Default is "false", using the common JDBC 2.0 setBinaryStream / setCharacterStream method for setting the content. Switch this to "true" for explicit JDBC 4.0 streaming, provided that your JDBC driver actually supports those JDBC 4.0 operations (e.g. Derby's).

        This setting affects stream arguments as well as byte array / String arguments, requiring JDBC 4.0 support. For supporting LOB content against JDBC 3.0, check out the "wrapAsLob" setting.

        另请参阅:
        PreparedStatement.setBlob(int, java.io.InputStream, long), PreparedStatement.setClob(int, java.io.Reader, long)
      • setCreateTemporaryLob

        public void setCreateTemporaryLob​(boolean createTemporaryLob)
        Specify whether to copy a byte array / String into a temporary JDBC Blob / Clob object created through the JDBC 4.0 createBlob / createClob methods.

        Default is "false", using the common JDBC 2.0 setBinaryStream / setCharacterStream method for setting the content. Switch this to "true" for explicit Blob / Clob creation using JDBC 4.0.

        This setting affects stream arguments as well as byte array / String arguments, requiring JDBC 4.0 support. For supporting LOB content against JDBC 3.0, check out the "wrapAsLob" setting.

        另请参阅:
        Connection.createBlob(), Connection.createClob()
      • getBlobAsBytes

        public byte[] getBlobAsBytes​(ResultSet rs,
                                     int columnIndex)
                              throws SQLException
        从接口复制的说明: LobHandler
        Retrieve the given column as bytes from the given ResultSet. Might simply invoke ResultSet.getBytes or work with ResultSet.getBlob, depending on the database and driver.
        参数:
        rs - the ResultSet to retrieve the content from
        columnIndex - the column index to use
        返回:
        the content as byte array, or null in case of SQL NULL
        抛出:
        SQLException - if thrown by JDBC methods
        另请参阅:
        ResultSet.getBytes(int)
      • getBlobAsBinaryStream

        public InputStream getBlobAsBinaryStream​(ResultSet rs,
                                                 int columnIndex)
                                          throws SQLException
        从接口复制的说明: LobHandler
        Retrieve the given column as binary stream from the given ResultSet. Might simply invoke ResultSet.getBinaryStream or work with ResultSet.getBlob, depending on the database and driver.
        参数:
        rs - the ResultSet to retrieve the content from
        columnIndex - the column index to use
        返回:
        the content as binary stream, or null in case of SQL NULL
        抛出:
        SQLException - if thrown by JDBC methods
        另请参阅:
        ResultSet.getBinaryStream(int)
      • getClobAsString

        public String getClobAsString​(ResultSet rs,
                                      int columnIndex)
                               throws SQLException
        从接口复制的说明: LobHandler
        Retrieve the given column as String from the given ResultSet. Might simply invoke ResultSet.getString or work with ResultSet.getClob, depending on the database and driver.
        参数:
        rs - the ResultSet to retrieve the content from
        columnIndex - the column index to use
        返回:
        the content as String, or null in case of SQL NULL
        抛出:
        SQLException - if thrown by JDBC methods
        另请参阅:
        ResultSet.getString(int)
      • getClobAsAsciiStream

        public InputStream getClobAsAsciiStream​(ResultSet rs,
                                                int columnIndex)
                                         throws SQLException
        从接口复制的说明: LobHandler
        Retrieve the given column as ASCII stream from the given ResultSet. Might simply invoke ResultSet.getAsciiStream or work with ResultSet.getClob, depending on the database and driver.
        参数:
        rs - the ResultSet to retrieve the content from
        columnIndex - the column index to use
        返回:
        the content as ASCII stream, or null in case of SQL NULL
        抛出:
        SQLException - if thrown by JDBC methods
        另请参阅:
        ResultSet.getAsciiStream(int)
      • getClobAsCharacterStream

        public Reader getClobAsCharacterStream​(ResultSet rs,
                                               int columnIndex)
                                        throws SQLException
        从接口复制的说明: LobHandler
        Retrieve the given column as character stream from the given ResultSet. Might simply invoke ResultSet.getCharacterStream or work with ResultSet.getClob, depending on the database and driver.
        参数:
        rs - the ResultSet to retrieve the content from
        columnIndex - the column index to use
        返回:
        the content as character stream
        抛出:
        SQLException - if thrown by JDBC methods
        另请参阅:
        ResultSet.getCharacterStream(int)
      • getLobCreator

        public LobCreator getLobCreator()
        从接口复制的说明: LobHandler
        Create a new LobCreator instance, i.e. a session for creating BLOBs and CLOBs. Needs to be closed after the created LOBs are not needed anymore - typically after statement execution or transaction completion.
        返回:
        the new LobCreator instance
        另请参阅:
        LobCreator.close()