Spring Framework LobHandler - 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 LobHandler class.

This code example shows how to use the following methods:getClobAsString
	@Override 
	protected Object nullSafeGetInternal( 
			ResultSet rs, String[] names, Object owner, LobHandler lobHandler) 
			throws SQLException { 
 
		return lobHandler.getClobAsString(rs, names[0]); 
	} 
 
	@Override 
	protected void nullSafeSetInternal( 
			PreparedStatement ps, int index, Object value, LobCreator lobCreator) 
			throws SQLException { 
 
		lobCreator.setClobAsString(ps, index, (String) value); 
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:getBlobAsBytes
	@Override 
	protected Object nullSafeGetInternal( 
			ResultSet rs, String[] names, Object owner, LobHandler lobHandler) 
			throws SQLException { 
 
		return lobHandler.getBlobAsBytes(rs, names[0]); 
	} 
 
	@Override 
	protected void nullSafeSetInternal( 
			PreparedStatement ps, int index, Object value, LobCreator lobCreator) 
			throws SQLException { 
 
		lobCreator.setBlobAsBytes(ps, index, (byte[]) value); 
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:getBlobAsBytes
	@Override 
	protected Object nullSafeGetInternal( 
			ResultSet rs, String[] names, Object owner, LobHandler lobHandler) 
			throws SQLException, UnsupportedEncodingException { 
 
		byte[] bytes = lobHandler.getBlobAsBytes(rs, names[0]); 
		if (bytes != null) { 
			String encoding = getCharacterEncoding(); 
			return (encoding != null ? new String(bytes, encoding) : new String(bytes)); 
		} 
		else { 
			return null; 
		} 
	} 
 
	@Override 
	protected void nullSafeSetInternal( 
			PreparedStatement ps, int index, Object value, LobCreator lobCreator) 
			throws SQLException, UnsupportedEncodingException { 
 
5
CodeRank
This code example shows how to use the following methods:getLobCreator
	 * @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(); 
	} 
 
	/** 
	 * Create a new CLOB value with the given content string, 
	 * 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()); 
	} 
 
	/** 
	 * Create a new CLOB value with the given content string. 
5
CodeRank
This code example shows how to use the following methods:getLobCreator
		if (this.lobHandler == null) { 
			throw new IllegalStateException("No LobHandler found for configuration - " + 
				"lobHandler property must be set on LocalSessionFactoryBean"); 
		} 
 
		LobCreator lobCreator = this.lobHandler.getLobCreator(); 
		try { 
			nullSafeSetInternal(st, index, value, lobCreator); 
		} 
		catch (IOException ex) { 
			throw new HibernateException("I/O errors during LOB access", ex); 
		} 
		LobCreatorUtils.registerTransactionSynchronization(lobCreator, this.jtaTransactionManager); 
	} 
 
	/** 
	 * Template method to extract a value from the given result set. 
	 * @param rs the ResultSet to extract from 
	 * @param names the column names 
	 * @param owner the containing entity 
5
CodeRank
See Code Examples for Spring Framework LobHandler Methods: