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);
}
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();
}
}
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() });
}
}
}
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();
}
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;
}
Aggregations