use of org.hsqldb_voltpatches.result.Result in project voltdb by VoltDB.
the class StatementInsert method getInsertSelectNavigator.
RowSetNavigator getInsertSelectNavigator(Session session) {
Type[] colTypes = baseTable.getColumnTypes();
int[] columnMap = insertColumnMap;
//
Result result = queryExpression.getResult(session, 0);
RowSetNavigator nav = result.initialiseNavigator();
Type[] sourceTypes = result.metaData.columnTypes;
RowSetNavigatorClient newData = new RowSetNavigatorClient(2);
while (nav.hasNext()) {
Object[] data = baseTable.getNewRowData(session);
Object[] sourceData = (Object[]) nav.getNext();
for (int i = 0; i < columnMap.length; i++) {
int j = columnMap[i];
Type sourceType = sourceTypes[i];
data[j] = colTypes[j].convertToType(session, sourceData[i], sourceType);
}
newData.add(data);
}
return newData;
}
use of org.hsqldb_voltpatches.result.Result in project voltdb by VoltDB.
the class Session method getAttributesResult.
private Result getAttributesResult(int id) {
Result r = Result.newSessionAttributesResult();
Object[] data = r.getSingleRowData();
data[SessionInterface.INFO_ID] = ValuePool.getInt(id);
switch(id) {
case SessionInterface.INFO_ISOLATION:
data[SessionInterface.INFO_INTEGER] = ValuePool.getInt(isolationMode);
break;
case SessionInterface.INFO_AUTOCOMMIT:
data[SessionInterface.INFO_BOOLEAN] = ValuePool.getBoolean(isAutoCommit);
break;
case SessionInterface.INFO_CONNECTION_READONLY:
data[SessionInterface.INFO_BOOLEAN] = ValuePool.getBoolean(isReadOnly);
break;
case SessionInterface.INFO_CATALOG:
data[SessionInterface.INFO_VARCHAR] = database.getCatalogName().name;
break;
}
return r;
}
use of org.hsqldb_voltpatches.result.Result in project voltdb by VoltDB.
the class SessionData method closeNavigator.
public void closeNavigator(long id) {
Result result = (Result) resultMap.remove(id);
result.getNavigator().close();
}
use of org.hsqldb_voltpatches.result.Result in project voltdb by VoltDB.
the class LobManager method createClob.
public long createClob(long length) {
long lobID = getNewLobID(sysLobSession);
ResultMetaData meta = createLob.getParametersMetaData();
Object[] params = new Object[meta.getColumnCount()];
params[0] = Long.valueOf(lobID);
params[1] = Long.valueOf(length);
params[2] = Long.valueOf(1);
params[3] = Integer.valueOf(Types.SQL_CLOB);
Result result = sysLobSession.executeCompiledStatement(createLob, params);
return lobID;
}
use of org.hsqldb_voltpatches.result.Result in project voltdb by VoltDB.
the class LobManager method setBytes.
public Result setBytes(Session session, long lobID, byte[] dataBytes, long offset) {
if (dataBytes.length == 0) {
return ResultLob.newLobSetResponse(lobID, 0);
}
Object[] data = getLobHeader(session, lobID);
if (data == null) {
return Result.newErrorResult(Error.error(ErrorCode.X_0F502));
}
long length = ((Long) data[1]).longValue();
Result result = setBytesBA(session, lobID, dataBytes, offset, dataBytes.length);
if (offset + dataBytes.length > length) {
setLength(session, lobID, offset + dataBytes.length);
}
return result;
}
Aggregations