Java Code Examples for java.sql.CallableStatement.getClob()

The following are Jave code examples for showing how to use getClob() of the java.sql.CallableStatement class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: tangyuan2   File: ClobTypeHandler.java   Source Code and License Vote up 5 votes
@Override
public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
	String value = "";
	Clob clob = cs.getClob(columnIndex);
	if (clob != null) {
		int size = (int) clob.length();
		value = clob.getSubString(1, size);
	}
	return value;
}
 
Example 2
Project: tangyuan2   File: NClobTypeHandler.java   Source Code and License Vote up 5 votes
@Override
public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
	String value = "";
	Clob clob = cs.getClob(columnIndex);
	if (clob != null) {
		int size = (int) clob.length();
		value = clob.getSubString(1, size);
	}
	return value;
}
 
Example 3
Project: jaffa-framework   File: TypeDefs.java   Source Code and License Vote up 3 votes
/** Gets a parameter from the CallableStatement.
 * @return the parameter.
 * @param engineType The engine type as defined in init.xml
 * @param cstmt The CallableStatement.
 * @param parameterIndex The index of the parameter.
 * @throws SQLException if a database access error occurs.
 * @throws IOException if any error occurs in reading the data from the database.
 */
public Object getAppObject(CallableStatement cstmt, int parameterIndex, String engineType) throws SQLException, IOException {
    Clob clob = cstmt.getClob(parameterIndex);
    if (clob != null)
        return StringHelper.getString(clob.getCharacterStream());
    else
        return null;
}