本文整理匯總了Java中java.sql.CallableStatement.getClob方法的典型用法代碼示例。如果您正苦於以下問題:Java CallableStatement.getClob方法的具體用法?Java CallableStatement.getClob怎麽用?Java CallableStatement.getClob使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.sql.CallableStatement
的用法示例。
在下文中一共展示了CallableStatement.getClob方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getNullableResult
import java.sql.CallableStatement; //導入方法依賴的package包/類
@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;
}
示例2: getAppObject
import java.sql.CallableStatement; //導入方法依賴的package包/類
/** 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;
}