JDBCClobClient.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:OpenDiabetes 作者:
/**
 * Retrieves the character position at which the specified
 * <code>Clob</code> object <code>searchstr</code> appears in this
 * <code>Clob</code> object.
 *
 * @param searchstr the <code>Clob</code> object for which to search
 * @param start the position at which to begin searching; the first
 *   position is 1
 * @return the position at which the <code>Clob</code> object appears or
 *   -1 if it is not present; the first position is 1
 * @throws SQLException if there is an error accessing the
 *   <code>CLOB</code> value
 */
public synchronized long position(Clob searchstr,
                                  long start) throws SQLException {

    if (!isInLimits(Long.MAX_VALUE, start - 1, 0)) {
        throw JDBCUtil.outOfRangeArgument();
    }

    if (searchstr instanceof JDBCClobClient) {
        ClobDataID searchClob = ((JDBCClobClient) searchstr).clob;

        try {
            return clob.position(session, searchClob, start - 1);
        } catch (HsqlException e) {
            throw JDBCUtil.sqlException(e);
        }
    }

    return position(searchstr.getSubString(1, (int) searchstr.length()),
                    start);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号