Package org.springframework.jdbc.support.lob

Examples of org.springframework.jdbc.support.lob.DefaultLobHandler


   * using a DefaultLobHandler.
   * @param bytes the byte array containing the BLOB value
   * @see org.springframework.jdbc.support.lob.DefaultLobHandler
   */
  public SqlLobValue(byte[] bytes) {
    this(bytes, new DefaultLobHandler());
  }
View Full Code Here


   * using a DefaultLobHandler.
   * @param content the String containing the CLOB value
   * @see org.springframework.jdbc.support.lob.DefaultLobHandler
   */
  public SqlLobValue(String content) {
    this(content, new DefaultLobHandler());
  }
View Full Code Here

   * @param stream the stream containing the LOB value
   * @param length the length of the LOB value
   * @see org.springframework.jdbc.support.lob.DefaultLobHandler
   */
  public SqlLobValue(InputStream stream, int length) {
    this(stream, length, new DefaultLobHandler());
  }
View Full Code Here

   * @param reader the character stream containing the CLOB value
   * @param length the length of the CLOB value
   * @see org.springframework.jdbc.support.lob.DefaultLobHandler
   */
  public SqlLobValue(Reader reader, int length) {
    this(reader, length, new DefaultLobHandler());
  }
View Full Code Here

* @since 17.12.2003
*/
public class DefaultLobHandlerTests extends TestCase {

  public void testGetBlobAsBytes() throws SQLException {
    LobHandler lobHandler = new DefaultLobHandler();
    MockControl rsControl = MockControl.createControl(ResultSet.class);
    ResultSet rs = (ResultSet) rsControl.getMock();
    rs.getBytes(1);
    rsControl.setReturnValue(null);
    rsControl.replay();
    lobHandler.getBlobAsBytes(rs, 1);
    rsControl.verify();
  }
View Full Code Here

    lobHandler.getBlobAsBytes(rs, 1);
    rsControl.verify();
  }

  public void testGetBlobAsBinaryStream() throws SQLException {
    LobHandler lobHandler = new DefaultLobHandler();
    MockControl rsControl = MockControl.createControl(ResultSet.class);
    ResultSet rs = (ResultSet) rsControl.getMock();
    rs.getBinaryStream(1);
    rsControl.setReturnValue(null);
    rsControl.replay();
    lobHandler.getBlobAsBinaryStream(rs, 1);
    rsControl.verify();
  }
View Full Code Here

    lobHandler.getBlobAsBinaryStream(rs, 1);
    rsControl.verify();
  }

  public void testGetClobAsString() throws SQLException {
    LobHandler lobHandler = new DefaultLobHandler();
    MockControl rsControl = MockControl.createControl(ResultSet.class);
    ResultSet rs = (ResultSet) rsControl.getMock();
    rs.getString(1);
    rsControl.setReturnValue(null);
    rsControl.replay();
    lobHandler.getClobAsString(rs, 1);
    rsControl.verify();
  }
View Full Code Here

    lobHandler.getClobAsString(rs, 1);
    rsControl.verify();
  }

  public void testGetClobAsAsciiStream() throws SQLException {
    LobHandler lobHandler = new DefaultLobHandler();
    MockControl rsControl = MockControl.createControl(ResultSet.class);
    ResultSet rs = (ResultSet) rsControl.getMock();
    rs.getAsciiStream(1);
    rsControl.setReturnValue(null);
    rsControl.replay();
    lobHandler.getClobAsAsciiStream(rs, 1);
    rsControl.verify();
  }
View Full Code Here

    lobHandler.getClobAsAsciiStream(rs, 1);
    rsControl.verify();
  }

  public void testGetClobAsCharacterStream() throws SQLException {
    LobHandler lobHandler = new DefaultLobHandler();
    MockControl rsControl = MockControl.createControl(ResultSet.class);
    ResultSet rs = (ResultSet) rsControl.getMock();
    rs.getCharacterStream(1);
    rsControl.setReturnValue(null);
    rsControl.replay();
    lobHandler.getClobAsCharacterStream(rs, 1);
    rsControl.verify();
  }
View Full Code Here

    lobHandler.getClobAsCharacterStream(rs, 1);
    rsControl.verify();
  }

  public void testSetBlobAsBytes() throws SQLException {
    LobCreator lobCreator = (new DefaultLobHandler()).getLobCreator();
    byte[] content = "testContent".getBytes();

    MockControl psControl = MockControl.createControl(PreparedStatement.class);
    PreparedStatement ps = (PreparedStatement) psControl.getMock();
    ps.setBytes(1, content);
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.support.lob.DefaultLobHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.