本文整理汇总了Java中org.hsqldb.types.ClobDataID.getSubString方法的典型用法代码示例。如果您正苦于以下问题:Java ClobDataID.getSubString方法的具体用法?Java ClobDataID.getSubString怎么用?Java ClobDataID.getSubString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.types.ClobDataID
的用法示例。
在下文中一共展示了ClobDataID.getSubString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getString
import org.hsqldb.types.ClobDataID; //导入方法依赖的package包/类
/**
* <!-- start generic documentation -->
* Retrieves the value of the designated column in the current row
* of this <code>ResultSet</code> object as
* a <code>String</code> in the Java programming language.
* <!-- end generic documentation -->
*
* @param columnIndex the first column is 1, the second is 2, ...
* @return the column value; if the value is SQL <code>NULL</code>, the
* value returned is <code>null</code>
* @exception SQLException if a database access error occurs or this method is
* called on a closed result set
*/
public String getString(int columnIndex) throws SQLException {
checkColumn(columnIndex);
Type sourceType = resultMetaData.columnTypes[columnIndex - 1];
if (sourceType.typeCode == Types.SQL_CLOB) {
ClobDataID x = (ClobDataID) getColumnInType(columnIndex,
sourceType);
if (x == null) {
return null;
}
long length = x.length(session);
if (length > Integer.MAX_VALUE) {
JDBCUtil.throwError(Error.error(ErrorCode.X_42561));
}
return x.getSubString(session, 0, (int) length);
}
return (String) getColumnInType(columnIndex, Type.SQL_VARCHAR);
}
示例2: getString
import org.hsqldb.types.ClobDataID; //导入方法依赖的package包/类
/**
* <!-- start generic documentation -->
* Retrieves the value of the designated column in the current row
* of this <code>ResultSet</code> object as
* a <code>String</code> in the Java programming language.
* <!-- end generic documentation -->
*
* @param columnIndex the first column is 1, the second is 2, ...
* @return the column value; if the value is SQL <code>NULL</code>, the
* value returned is <code>null</code>
* @exception SQLException if a database access error occurs or this method is
* called on a closed result set
*/
public String getString(int columnIndex) throws SQLException {
checkColumn(columnIndex);
Type sourceType = resultMetaData.columnTypes[columnIndex - 1];
if (sourceType.typeCode == Types.SQL_CLOB) {
ClobDataID x = (ClobDataID) getColumnInType(columnIndex,
sourceType);
if (x == null) {
return null;
}
long length = x.length(session);
if (length > Integer.MAX_VALUE) {
Util.throwError(Error.error(ErrorCode.X_42561));
}
return x.getSubString(session, 0, (int) length);
}
return (String) getColumnInType(columnIndex, Type.SQL_VARCHAR);
}