Code example for Clob

Methods: getSubString, length

0
 
	public Object getResult(ResultGetter getter) throws SQLException {
		String value;
		Clob clob = getter.getClob();
		if (!getter.wasNull()) {
			int size = (int) clob.length();
			value = clob.getSubString(1, size);
		} else { 
			value = null;
		} 
 
		return value;
	} 
 
	public void setParameter(ParameterSetter setter, Object parameter) throws SQLException {
		String s = (String) parameter;
		if (s != null) {
			StringReader reader = new StringReader(s);
			setter.setCharacterStream(reader, s.length());
		} else { 
			setter.setNull(Types.CLOB);