Spring Framework DefaultLobHandler - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework DefaultLobHandler class.

This code example shows how to use the following methods:setWrapAsLob
  } 
 
  //------------------------------------------------------------------------- 
  @Override 
  public LobHandler getLobHandler() {
    DefaultLobHandler handler = new DefaultLobHandler();
    handler.setWrapAsLob(true);
    return handler;
  } 
 
  /** 
   * Returns the prefix with the correct wildcard search type. 
   * Returns 'prefix LIKE paramName ' if there are wildcards, 
   * 'prefix = paramName ' if no wildcards and '' if null. 
   * The prefix is normally 'AND columnName ' or 'OR columnName '. 
   *  
   * @param prefix  the prefix such as 'AND columnName ', not null 
   * @param paramName  the parameter name normally prefixed by colon, not null 
   * @param value  the string value, may be null 
   * @return the SQL fragment, not null 
6
CodeRank
This code example shows how to use the following methods:
	 * 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()); 
	} 
 
	/** 
	 * Create a new BLOB value with the given byte array. 
	 * @param bytes the byte array containing the BLOB value 
	 * @param lobHandler the LobHandler to be used 
	 */ 
	public SqlLobValue(byte[] bytes, LobHandler lobHandler) { 
		this.content = bytes; 
		this.length = (bytes != null ? bytes.length : 0); 
		this.lobCreator = lobHandler.getLobCreator(); 
	} 
 
	/** 
5
CodeRank
This code example shows how to use the following methods:
        this.binding = binding;
        this.colNum = colNum;
 
        // TODO: be careful this may not work with 
        // Oracle and need an OracleLobHandler 
        this.lobHandler = new DefaultLobHandler();
    } 
 
    @Override 
    public T mapRow(final ResultSet rs, final int rowNum) throws SQLException {
        // InputStream binaryStream = lobHandler.getBlobAsBinaryStream(rs, colNum); 
        String xml = rs.getString(colNum);
        ByteArrayInputStream in;
        try { 
            byte[] bytes = xml.getBytes("UTF-8");
            in = new ByteArrayInputStream(bytes);
        } catch (UnsupportedEncodingException e) {
            throw Throwables.propagate(e);
        } 
        return binding.entryToObject(in, type);
5
CodeRank
This code example shows how to use the following methods:
   * Subclasses will return different handlers for different dialects. 
   *  
   * @return the LOB handler, not null 
   */ 
  public LobHandler getLobHandler() {
    return new DefaultLobHandler();
  } 
 
  //------------------------------------------------------------------------- 
  /** 
   * Gets the precision of a timestamp, the default is microseconds. 
   *  
   * @return the precision of a timestamp, default is Microseconds, not null 
   */ 
  public TemporalUnit getTimestampPrecision() { 
    return ChronoUnit.MICROS; 
  } 
 
  //------------------------------------------------------------------------- 
  /** 
4
CodeRank
This code example shows how to use the following methods:
 
	private volatile DeserializingConverter deserializer; 
 
	private volatile SerializingConverter serializer; 
 
	private volatile LobHandler lobHandler = new DefaultLobHandler(); 
 
	private volatile MessageRowMapper messageRowMapper; 
 
	private volatile Map<String, String> queryCache = new HashMap<String, String>(); 
 
	private boolean usingIdCache = false; 
 
	private boolean priorityEnabled; 
 
	/** 
	 * Convenient constructor for configuration use. 
	 */ 
	public JdbcChannelMessageStore() { 
		deserializer = new DeserializingConverter(); 
3
CodeRank
See Code Examples for Spring Framework DefaultLobHandler Methods: