Search in sources :

Example 11 with ResultLob

use of org.hsqldb_voltpatches.result.ResultLob in project voltdb by VoltDB.

the class BlobDataID method position.

public long position(SessionInterface session, byte[] pattern, long start) {
    ResultLob resultOut = ResultLob.newLobGetBytePatternPositionRequest(id, pattern, start);
    ResultLob resultIn = (ResultLob) session.execute(resultOut);
    return resultIn.getOffset();
}
Also used : ResultLob(org.hsqldb_voltpatches.result.ResultLob)

Example 12 with ResultLob

use of org.hsqldb_voltpatches.result.ResultLob in project voltdb by VoltDB.

the class ClobDataID method setString.

public int setString(SessionInterface session, long pos, String str, int offset, int len) {
    if (!isInLimits(str.length(), offset, len)) {
        throw Error.error(ErrorCode.X_22001);
    }
    ResultLob resultOut = ResultLob.newLobSetCharsRequest(id, pos, str.substring(offset, len).toCharArray());
    Result resultIn = session.execute(resultOut);
    if (resultIn.isError()) {
        throw resultIn.getException();
    }
    return str.length();
}
Also used : ResultLob(org.hsqldb_voltpatches.result.ResultLob) Result(org.hsqldb_voltpatches.result.Result)

Example 13 with ResultLob

use of org.hsqldb_voltpatches.result.ResultLob in project voltdb by VoltDB.

the class ClobDataID method getChars.

public char[] getChars(SessionInterface session, long position, int length) {
    ResultLob resultOut = ResultLob.newLobGetCharsRequest(id, position, length);
    Result resultIn = session.execute(resultOut);
    if (resultIn.isError()) {
        throw resultIn.getException();
    }
    return ((ResultLob) resultIn).getCharArray();
}
Also used : ResultLob(org.hsqldb_voltpatches.result.ResultLob) Result(org.hsqldb_voltpatches.result.Result)

Example 14 with ResultLob

use of org.hsqldb_voltpatches.result.ResultLob in project voltdb by VoltDB.

the class ClobDataID method setString.

public int setString(SessionInterface session, long pos, String str) {
    ResultLob resultOut = ResultLob.newLobSetCharsRequest(id, pos, str.toCharArray());
    Result resultIn = session.execute(resultOut);
    if (resultIn.isError()) {
        throw resultIn.getException();
    }
    return str.length();
}
Also used : ResultLob(org.hsqldb_voltpatches.result.ResultLob) Result(org.hsqldb_voltpatches.result.Result)

Example 15 with ResultLob

use of org.hsqldb_voltpatches.result.ResultLob in project voltdb by VoltDB.

the class BlobDataID method setBytes.

public int setBytes(SessionInterface session, long pos, byte[] bytes, int offset, int len) {
    ResultLob resultOut = ResultLob.newLobSetBytesRequest(id, pos, bytes);
    Result resultIn = (ResultLob) session.execute(resultOut);
    if (resultIn.isError()) {
        throw resultIn.getException();
    }
    return bytes.length;
}
Also used : ResultLob(org.hsqldb_voltpatches.result.ResultLob) Result(org.hsqldb_voltpatches.result.Result)

Aggregations

ResultLob (org.hsqldb_voltpatches.result.ResultLob)15 Result (org.hsqldb_voltpatches.result.Result)13 EOFException (java.io.EOFException)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 Reader (java.io.Reader)1 Blob (java.sql.Blob)1 Clob (java.sql.Clob)1 NClob (java.sql.NClob)1 HsqlException (org.hsqldb_voltpatches.HsqlException)1 SchemaObject (org.hsqldb_voltpatches.SchemaObject)1 CountdownInputStream (org.hsqldb_voltpatches.lib.CountdownInputStream)1 HsqlByteArrayInputStream (org.hsqldb_voltpatches.lib.HsqlByteArrayInputStream)1 BlobDataID (org.hsqldb_voltpatches.types.BlobDataID)1 ClobDataID (org.hsqldb_voltpatches.types.ClobDataID)1