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

This code example shows how to use the following methods:setValue
 
		if (inValue instanceof SqlTypeValue) {
			((SqlTypeValue) inValue).setTypeValue(ps, paramIndex, sqlType, typeName);
		} 
		else if (inValue instanceof SqlValue) {
			((SqlValue) inValue).setValue(ps, paramIndex);
		} 
		else if (sqlType == Types.VARCHAR || sqlType == Types.NVARCHAR ||
				sqlType == Types.LONGVARCHAR || sqlType == Types.LONGNVARCHAR) {
			ps.setString(paramIndex, inValue.toString());
		} 
		else if ((sqlType == Types.CLOB || sqlType == Types.NCLOB) && isStringValue(inValue.getClass())) {
			String strVal = inValue.toString();
			if (strVal.length() > 4000) {
				// Necessary for older Oracle drivers, in particular when running against an Oracle 10 database. 
				// Should also work fine against other drivers/databases since it uses standard JDBC 4.0 API. 
				try { 
					if (sqlType == Types.NCLOB) {
						ps.setNClob(paramIndex, new StringReader(strVal), strVal.length());
					} 
4
CodeRank
See Code Examples for Spring Framework SqlValue Methods: