Search in sources :

Example 26 with Result

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

the class BlobDataID method getBlob.

public BlobData getBlob(SessionInterface session, long pos, long length) {
    ResultLob resultOut = ResultLob.newLobGetRequest(id, pos, length);
    Result resultIn = session.execute(resultOut);
    if (resultIn.isError()) {
        throw Error.error(resultIn);
    }
    long lobID = ((ResultLob) resultIn).getLobID();
    return new BlobDataID(lobID);
}
Also used : ResultLob(org.hsqldb_voltpatches.result.ResultLob) Result(org.hsqldb_voltpatches.result.Result)

Example 27 with Result

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

the class BlobDataID method truncate.

public void truncate(SessionInterface session, long len) {
    ResultLob resultOut = ResultLob.newLobTruncateRequest(id, len);
    Result resultIn = session.execute(resultOut);
    if (resultIn.isError()) {
        throw resultIn.getException();
    }
}
Also used : ResultLob(org.hsqldb_voltpatches.result.ResultLob) Result(org.hsqldb_voltpatches.result.Result)

Example 28 with Result

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

the class ScriptReaderText method readDDL.

protected void readDDL(Session session) throws IOException {
    for (; readLoggedStatement(session); ) {
        Statement cs = null;
        Result result = null;
        if (rowIn.getStatementType() == INSERT_STATEMENT) {
            isInsert = true;
            break;
        }
        try {
            cs = session.compileStatement(statement);
            result = session.executeCompiledStatement(cs, ValuePool.emptyObjectArray);
            if (cs.getType() == StatementTypes.CREATE_SCHEMA) {
                HsqlName name = cs.getSchemaName();
                session.setSchema(name.name);
            }
        } catch (HsqlException e) {
            result = Result.newErrorResult(e);
        }
        if (result.isError()) {
            // handle grants on math and library routines in old versions
            if (cs == null) {
            } else {
                if (cs.getType() == StatementTypes.GRANT) {
                    continue;
                }
            }
        //
        }
        if (result.isError()) {
            db.logger.appLog.logContext(SimpleLog.LOG_ERROR, result.getMainString());
            throw Error.error(ErrorCode.ERROR_IN_SCRIPT_FILE, ErrorCode.M_DatabaseScriptReader_readDDL, new Object[] { new Integer(lineCount), result.getMainString() });
        }
    }
}
Also used : Statement(org.hsqldb_voltpatches.Statement) HsqlName(org.hsqldb_voltpatches.HsqlNameManager.HsqlName) HsqlException(org.hsqldb_voltpatches.HsqlException) Result(org.hsqldb_voltpatches.result.Result)

Example 29 with Result

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

the class ClobDataID method length.

public long length(SessionInterface session) {
    ResultLob resultOut = ResultLob.newLobGetLengthRequest(id);
    Result resultIn = session.execute(resultOut);
    if (resultIn.isError()) {
        throw resultIn.getException();
    }
    return ((ResultLob) resultIn).getBlockLength();
}
Also used : ResultLob(org.hsqldb_voltpatches.result.ResultLob) Result(org.hsqldb_voltpatches.result.Result)

Example 30 with Result

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

the class ClobDataID method setChars.

public int setChars(SessionInterface session, long pos, char[] chars, int offset, int len) {
    if (!isInLimits(chars.length, offset, len)) {
        throw Error.error(ErrorCode.X_22001);
    }
    char[] newChars = new char[len];
    System.arraycopy(chars, offset, newChars, 0, len);
    ResultLob resultOut = ResultLob.newLobSetCharsRequest(id, pos, chars);
    Result resultIn = session.execute(resultOut);
    if (resultIn.isError()) {
        throw resultIn.getException();
    }
    return len;
}
Also used : ResultLob(org.hsqldb_voltpatches.result.ResultLob) Result(org.hsqldb_voltpatches.result.Result)

Aggregations

Result (org.hsqldb_voltpatches.result.Result)83 Session (org.hsqldb_voltpatches.Session)18 PersistentStore (org.hsqldb_voltpatches.persist.PersistentStore)16 HsqlName (org.hsqldb_voltpatches.HsqlNameManager.HsqlName)15 Table (org.hsqldb_voltpatches.Table)14 ResultLob (org.hsqldb_voltpatches.result.ResultLob)13 TextTable (org.hsqldb_voltpatches.TextTable)12 ResultMetaData (org.hsqldb_voltpatches.result.ResultMetaData)11 RowSetNavigator (org.hsqldb_voltpatches.navigator.RowSetNavigator)10 HsqlException (org.hsqldb_voltpatches.HsqlException)5 RowSetNavigatorData (org.hsqldb_voltpatches.navigator.RowSetNavigatorData)4 EOFException (java.io.EOFException)3 RowSetNavigatorClient (org.hsqldb_voltpatches.navigator.RowSetNavigatorClient)3 IOException (java.io.IOException)2 RangeIteratorBase (org.hsqldb_voltpatches.RangeVariable.RangeIteratorBase)2 Statement (org.hsqldb_voltpatches.Statement)2 HashMappedList (org.hsqldb_voltpatches.lib.HashMappedList)2 HsqlArrayList (org.hsqldb_voltpatches.lib.HsqlArrayList)2 HsqlByteArrayInputStream (org.hsqldb_voltpatches.lib.HsqlByteArrayInputStream)2 Iterator (org.hsqldb_voltpatches.lib.Iterator)2