当前位置: 首页>>代码示例>>Java>>正文


Java ClobDataID类代码示例

本文整理汇总了Java中org.hsqldb.types.ClobDataID的典型用法代码示例。如果您正苦于以下问题:Java ClobDataID类的具体用法?Java ClobDataID怎么用?Java ClobDataID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ClobDataID类属于org.hsqldb.types包,在下文中一共展示了ClobDataID类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getClob

import org.hsqldb.types.ClobDataID; //导入依赖的package包/类
public ClobData getClob(long lobID) {

        writeLock.lock();

        try {
            Object[] data = getLobHeader(lobID);

            if (data == null) {
                return null;
            }

            ClobData clob = new ClobDataID(lobID);

            return clob;
        } finally {
            writeLock.unlock();
        }
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:19,代码来源:LobManager.java

示例2: position

import org.hsqldb.types.ClobDataID; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:34,代码来源:JDBCClobClient.java

示例3: 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);
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:39,代码来源:JDBCResultSet.java

示例4: position

import org.hsqldb.types.ClobDataID; //导入依赖的package包/类
/**
 * 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 Util.outOfRangeArgument();
    }

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

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

    return position(searchstr.getSubString(1, (int) searchstr.length()),
                    start);
}
 
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:34,代码来源:JDBCClobClient.java

示例5: 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);
}
 
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:39,代码来源:JDBCResultSet.java

示例6: getClob

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>Clob</code> object
 * in the Java programming language.
 * <!-- end generic documentation -->
 *
 * <!-- start release-specific documentation -->
 * <div class="ReleaseSpecificDocumentation">
 * <h3>HSQLDB-Specific Information:</h3> <p>
 *
 * HSQLDB 2.0 supports this feature for objects of type CLOB and
 * the variations of CHAR.
 * The Clob returned for CHAR objects is a memory object. The Clob
 * return for CLOB objects is not held entirely in memory. Its contents are
 * fetched from the database when its getXXX() methods are called. <p>
 * </div>
 * <!-- end release-specific documentation -->
 *
 * @param columnIndex the first column is 1, the second is 2, ...
 * @return a <code>Clob</code> object representing the SQL
 *         <code>CLOB</code> value in the specified column
 * @exception SQLException if a database access error occurs
 * or this method is called on a closed result set
 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
 * this method
 * @since JDK 1.2
 */
public Clob getClob(int columnIndex) throws SQLException {

    checkColumn(columnIndex);

    Type   sourceType = resultMetaData.columnTypes[columnIndex - 1];
    Object o          = getColumnInType(columnIndex, sourceType);

    if (o == null) {
        return null;
    }

    if (o instanceof ClobDataID) {
        JDBCClobClient clob = new JDBCClobClient(session, (ClobDataID) o);

        if (isUpdatable) {
            if (resultMetaData.colIndexes[columnIndex - 1] > 0
                    && resultMetaData.columns[columnIndex - 1]
                        .isWriteable()) {
                clob.setWritable(this, columnIndex - 1);
            }
        }

        return clob;
    } else if (o instanceof Clob) {
        return (Clob) o;
    } else if (o instanceof String) {
        return new JDBCClob((String) o);
    }

    throw JDBCUtil.sqlException(ErrorCode.X_42561);
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:60,代码来源:JDBCResultSet.java

示例7: getClob

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>Clob</code> object
 * in the Java programming language.
 * <!-- end generic documentation -->
 *
 * <!-- start release-specific documentation -->
 * <div class="ReleaseSpecificDocumentation">
 * <h3>HSQLDB-Specific Information:</h3> <p>
 *
 * HSQLDB 2.0 supports this feature for objects of type CLOB and
 * the variations of CHAR.
 * The Clob returned for CHAR objects is a memory object. The Clob
 * return for CLOB objects is not held entirely in memory. Its contents are
 * fetched from the database when its getXXX() methods are called. <p>
 * </div>
 * <!-- end release-specific documentation -->
 *
 * @param columnIndex the first column is 1, the second is 2, ...
 * @return a <code>Clob</code> object representing the SQL
 *         <code>CLOB</code> value in the specified column
 * @exception SQLException if a database access error occurs
 * or this method is called on a closed result set
 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
 * this method
 * @since JDK 1.2
 */
public Clob getClob(int columnIndex) throws SQLException {

    checkColumn(columnIndex);

    Type   sourceType = resultMetaData.columnTypes[columnIndex - 1];
    Object o          = getColumnInType(columnIndex, sourceType);

    if (o == null) {
        return null;
    }

    if (o instanceof ClobDataID) {
        JDBCClobClient clob = new JDBCClobClient(session, (ClobDataID) o);

        if (isUpdatable) {
            if (resultMetaData.colIndexes[columnIndex - 1] > 0
                    && resultMetaData.columns[columnIndex - 1]
                        .isWriteable()) {
                clob.setWritable(this, columnIndex - 1);
            }
        }

        return clob;
    } else if (o instanceof Clob) {
        return (Clob) o;
    } else if (o instanceof String) {
        return new JDBCClob((String) o);
    }

    throw Util.sqlException(ErrorCode.X_42561);
}
 
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:60,代码来源:JDBCResultSet.java

示例8: readClob

import org.hsqldb.types.ClobDataID; //导入依赖的package包/类
protected ClobData readClob() {

        String s = readString();

        if (s == null) {
            return null;
        }

        s = s.trim();

        if (s.length() == 0) {
            return null;
        }

        long id = Long.parseLong(s);

        return new ClobDataID(id);
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:19,代码来源:RowInputText.java

示例9: getClob

import org.hsqldb.types.ClobDataID; //导入依赖的package包/类
/**
 * <!-- start generic documentation -->
 *
 * Retrieves the value of the designated JDBC <code>CLOB</code> parameter as a
 * <code>java.sql.Clob</code> object in the Java programming language.
 *
 * <!-- end generic documentation -->
 *
 * <!-- start release-specific documentation -->
 * <div class="ReleaseSpecificDocumentation">
 * <h3>HSQLDB-Specific Information:</h3> <p>
 *
 * HSQLDB supports this feature. <p>
 *
 * </div>
 * <!-- end release-specific documentation -->
 *
 * @param parameterIndex the first parameter is 1, the second is 2, and
 * so on
 * @return the parameter value as a <code>Clob</code> object in the
 * Java programming language.  If the value was SQL <code>NULL</code>, the
 * value <code>null</code> is returned.
 * @exception SQLException  JDBC 4.1[if the parameterIndex is not valid;]
 * if a database access error occurs or
 * this method is called on a closed <code>CallableStatement</code>
 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
 * this method
 * @since JDK 1.2 (JDK 1.1.x developers: read the overview for
 *  JDBCParameterMetaData)
 */
public synchronized Clob getClob(int parameterIndex) throws SQLException {

    checkGetParameterIndex(parameterIndex);

    Type   sourceType = parameterMetaData.columnTypes[parameterIndex - 1];
    Object o          = getColumnInType(parameterIndex, sourceType);

    if (o == null) {
        return null;
    }

    if (o instanceof ClobDataID) {
        return new JDBCClobClient(session, (ClobDataID) o);
    }

    throw JDBCUtil.sqlException(ErrorCode.X_42561);
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:48,代码来源:JDBCCallableStatement.java

示例10: getCharacterStream

import org.hsqldb.types.ClobDataID; //导入依赖的package包/类
/**
     * <!-- start generic documentation -->
     *
     * Retrieves the value of the designated parameter as a
     * <code>java.io.Reader</code> object in the Java programming language.
     *
     * <!-- end generic documentstion -->
     *
     * <!-- start release-specific documentation -->
     * <div class="ReleaseSpecificDocumentation">
     * <h3>HSQLDB-Specific Information:</h3> <p>
     *
     * HSQLDB does not yet support this feature. <p>
     *
     * Calling this method always throws an <code>SQLException</code>.
     * </div>
     * <!-- end release-specific documentation -->
     *
     * @return a <code>java.io.Reader</code> object that contains the parameter
     * value; if the value is SQL <code>NULL</code>, the value returned is
     * <code>null</code> in the Java programming language.
     * @param parameterIndex the first parameter is 1, the second is 2, ...
     * @exception SQLException  JDBC 4.1[if the parameterIndex is not valid;] if a database access error occurs or
     * this method is called on a closed <code>CallableStatement</code>
     * @since JDK 1.6, HSQLDB 2.0
     */
//#ifdef JAVA6
    public Reader getCharacterStream(int parameterIndex) throws SQLException {

        checkGetParameterIndex(parameterIndex);

        Type   sourceType = parameterMetaData.columnTypes[parameterIndex - 1];
        Object o          = getColumnInType(parameterIndex, sourceType);

        if (o == null) {
            return null;
        }

        if (o instanceof ClobDataID) {
            return ((ClobDataID) o).getCharacterStream(session);
        } else if (o instanceof Clob) {
            return ((Clob) o).getCharacterStream();
        } else if (o instanceof String) {
            return new StringReader((String) o);
        }

        throw JDBCUtil.sqlException(ErrorCode.X_42561);
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:49,代码来源:JDBCCallableStatement.java

示例11: JDBCClobClient

import org.hsqldb.types.ClobDataID; //导入依赖的package包/类
public JDBCClobClient(SessionInterface session, ClobDataID clob) {
    this.session = session;
    this.clob    = clob;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:5,代码来源:JDBCClobClient.java

示例12: getClob

import org.hsqldb.types.ClobDataID; //导入依赖的package包/类
public ClobDataID getClob() {
    return clob;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:4,代码来源:JDBCClobClient.java

示例13: getCharacterStream

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>java.io.Reader</code> object.
 * <!-- end generic documentation -->
 *
 * <!-- start release-specific documentation -->
 * <div class="ReleaseSpecificDocumentation">
 * <h3>HSQLDB-Specific Information:</h3> <p>
 *
 * HSQLDB supports this feature. <p>
 * </div>
 * <!-- end release-specific documentation -->
 *
 * @return a <code>java.io.Reader</code> object that contains the column
 * value; if the value is SQL <code>NULL</code>, the value returned is
 * <code>null</code> in the Java programming language.
 * @param columnIndex the first column is 1, the second is 2, ...
 * @exception SQLException if a database access error occurs or this method is
 *            called on a closed result set
 * @since JDK 1.2
 */
public java.io.Reader getCharacterStream(
        int columnIndex) throws SQLException {

    checkColumn(columnIndex);

    Type   sourceType = resultMetaData.columnTypes[columnIndex - 1];
    Object o          = getColumnInType(columnIndex, sourceType);

    if (o == null) {
        return null;
    }

    if (o instanceof ClobDataID) {
        return ((ClobDataID) o).getCharacterStream(session);
    } else if (o instanceof Clob) {
        return ((Clob) o).getCharacterStream();
    } else if (o instanceof String) {
        return new StringReader((String) o);
    }

    throw JDBCUtil.sqlException(ErrorCode.X_42561);
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:46,代码来源:JDBCResultSet.java

示例14: readClob

import org.hsqldb.types.ClobDataID; //导入依赖的package包/类
protected ClobData readClob() throws IOException {

        String s = readString();

        if (s == null) {
            return null;
        }

        s = s.trim();

        if (s.length() == 0) {
            return null;
        }

        long id = Long.parseLong(s);

        return new ClobDataID(id);
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:19,代码来源:RowInputText.java

示例15: JDBCClobClient

import org.hsqldb.types.ClobDataID; //导入依赖的package包/类
JDBCClobClient(SessionInterface session, ClobDataID clob) {
    this.session = session;
    this.clob    = clob;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:5,代码来源:JDBCClobClient.java


注:本文中的org.hsqldb.types.ClobDataID类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。