本文整理汇总了Java中org.hsqldb.lib.ArrayUtil.arraySlice方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayUtil.arraySlice方法的具体用法?Java ArrayUtil.arraySlice怎么用?Java ArrayUtil.arraySlice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.lib.ArrayUtil
的用法示例。
在下文中一共展示了ArrayUtil.arraySlice方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Constraint
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Constructor declaration for UNIQUE
*/
Constraint(HsqlName name, Table t, Index index) {
core = new ConstraintCore();
constName = name;
constType = UNIQUE;
core.mainTable = t;
core.mainIndex = index;
/* fredt - in unique constraints column list for iColMain is the
visible columns of iMain
*/
core.mainColArray = ArrayUtil.arraySlice(index.getColumns(), 0,
index.getVisibleColumns());
core.colLen = core.mainColArray.length;
}
示例2: Constraint
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Constructor declaration for PK and UNIQUE
*/
Constraint(HsqlName name, Table t, Index index, int type) {
core = new ConstraintCore();
constName = name;
constType = type;
core.mainTable = t;
core.mainIndex = index;
/* fredt - in unique constraints column list for iColMain is the
visible columns of iMain
*/
core.mainColArray = ArrayUtil.arraySlice(index.getColumns(), 0,
index.getVisibleColumns());
core.colLen = core.mainColArray.length;
}
示例3: executeDirectBatchStatement
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
private Result executeDirectBatchStatement(Result cmd) {
int[] updateCounts;
int count;
count = 0;
RowSetNavigator nav = cmd.initialiseNavigator();
updateCounts = new int[nav.getSize()];
Result error = null;
while (nav.hasNext()) {
Result in;
Object[] data = nav.getNext();
String sql = (String) data[0];
try {
Statement cs = compileStatement(sql);
in = executeCompiledStatement(cs, ValuePool.emptyObjectArray,
cmd.queryTimeout);
} catch (Throwable t) {
in = Result.newErrorResult(t);
// if (t instanceof OutOfMemoryError) {
// System.gc();
// }
// "in" already equals "err"
// maybe test for OOME and do a gc() ?
// t.printStackTrace();
}
if (in.isUpdateCount()) {
updateCounts[count++] = in.getUpdateCount();
} else if (in.isData()) {
// FIXME: we don't have what it takes yet
// to differentiate between things like
// stored procedure calls to methods with
// void return type and select statements with
// a single row/column containing null
updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
} else if (in.mode == ResultConstants.CALL_RESPONSE) {
updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
} else if (in.mode == ResultConstants.ERROR) {
updateCounts = ArrayUtil.arraySlice(updateCounts, 0, count);
error = in;
break;
} else {
throw Error.runtimeError(ErrorCode.U_S0500, "Session");
}
}
return Result.newBatchedExecuteResponse(updateCounts, null, error);
}
示例4: executeDirectBatchStatement
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
private Result executeDirectBatchStatement(Result cmd) {
int[] updateCounts;
int count;
count = 0;
RowSetNavigator nav = cmd.initialiseNavigator();
updateCounts = new int[nav.getSize()];
Result error = null;
isBatch = true;
while (nav.hasNext()) {
Result in;
Object[] data = (Object[]) nav.getNext();
String sql = (String) data[0];
try {
in = executeDirectStatement(sql);
} catch (Throwable t) {
in = Result.newErrorResult(t);
// if (t instanceof OutOfMemoryError) {
// System.gc();
// }
// "in" alread equals "err"
// maybe test for OOME and do a gc() ?
// t.printStackTrace();
}
if (in.isUpdateCount()) {
updateCounts[count++] = in.getUpdateCount();
} else if (in.isData()) {
// FIXME: we don't have what it takes yet
// to differentiate between things like
// stored procedure calls to methods with
// void return type and select statements with
// a single row/column containg null
updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
} else if (in.isError()) {
updateCounts = ArrayUtil.arraySlice(updateCounts, 0, count);
error = in;
break;
} else {
throw Error.runtimeError(ErrorCode.U_S0500, "Session");
}
}
isBatch = false;
sessionData.updateLobUsageForBatch();
return Result.newBatchedExecuteResponse(updateCounts, null, error);
}
示例5: executeDirectBatchStatement
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
private Result executeDirectBatchStatement(Result cmd) {
int[] updateCounts;
int count;
count = 0;
RowSetNavigator nav = cmd.initialiseNavigator();
updateCounts = new int[nav.getSize()];
Result error = null;
while (nav.hasNext()) {
Result in;
Object[] data = (Object[]) nav.getNext();
String sql = (String) data[0];
try {
Statement cs = compileStatement(sql);
in = executeCompiledStatement(cs, ValuePool.emptyObjectArray,
cmd.queryTimeout);
} catch (Throwable t) {
in = Result.newErrorResult(t);
// if (t instanceof OutOfMemoryError) {
// System.gc();
// }
// "in" alread equals "err"
// maybe test for OOME and do a gc() ?
// t.printStackTrace();
}
if (in.isUpdateCount()) {
updateCounts[count++] = in.getUpdateCount();
} else if (in.isData()) {
// FIXME: we don't have what it takes yet
// to differentiate between things like
// stored procedure calls to methods with
// void return type and select statements with
// a single row/column containg null
updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
} else if (in.mode == ResultConstants.CALL_RESPONSE) {
updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
} else if (in.mode == ResultConstants.ERROR) {
updateCounts = ArrayUtil.arraySlice(updateCounts, 0, count);
error = in;
break;
} else {
throw Error.runtimeError(ErrorCode.U_S0500, "Session");
}
}
return Result.newBatchedExecuteResponse(updateCounts, null, error);
}
示例6: sqlExecuteBatch
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
private Result sqlExecuteBatch(Result cmd) {
int csid;
Record record;
Result out;
CompiledStatement cs;
Expression[] parameters;
int[] updateCounts;
int count;
csid = cmd.getStatementID();
cs = compiledStatementManager.getStatement(csid);
if (cs == null) {
cs = recompileStatement(csid);
if (cs == null) {
// invalid sql has been removed already
return Trace.toResult(
Trace.error(Trace.INVALID_PREPARED_STATEMENT));
}
}
parameters = cs.parameters;
count = 0;
updateCounts = new int[cmd.getSize()];
record = cmd.rRoot;
while (record != null) {
Result in;
Object[] pvals = record.data;
try {
for (int i = 0; i < parameters.length; i++) {
parameters[i].bind(pvals[i]);
}
in = compiledStatementExecutor.execute(cs);
} catch (Throwable t) {
in = new Result(ResultConstants.ERROR);
// t.printStackTrace();
// Trace.printSystemOut(t.toString());
// if (t instanceof OutOfMemoryError) {
// System.gc();
// }
// "in" alread equals "err"
// maybe test for OOME and do a gc() ?
// t.printStackTrace();
}
// On the client side, iterate over the vals and throw
// a BatchUpdateException if a batch status value of
// esultConstants.EXECUTE_FAILED is encountered in the result
if (in.mode == ResultConstants.UPDATECOUNT) {
updateCounts[count++] = in.updateCount;
} else if (in.mode == ResultConstants.DATA) {
// FIXME: we don't have what it takes yet
// to differentiate between things like
// stored procedure calls to methods with
// void return type and select statements with
// a single row/column containg null
updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
} else {
updateCounts = ArrayUtil.arraySlice(updateCounts, 0, count);
break;
}
record = record.next;
}
out = new Result(ResultConstants.SQLEXECUTE, updateCounts, 0);
return out;
}
示例7: sqlExecuteBatchDirect
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
private Result sqlExecuteBatchDirect(Result cmd) {
Record record;
Result out;
int[] updateCounts;
int count;
count = 0;
updateCounts = new int[cmd.getSize()];
record = cmd.rRoot;
while (record != null) {
Result in;
String sql = (String) record.data[0];
try {
in = dbCommandInterpreter.execute(sql);
} catch (Throwable t) {
in = new Result(ResultConstants.ERROR);
// if (t instanceof OutOfMemoryError) {
// System.gc();
// }
// "in" alread equals "err"
// maybe test for OOME and do a gc() ?
// t.printStackTrace();
}
// On the client side, iterate over the colType vals and throw
// a BatchUpdateException if a batch status value of
// ResultConstants.EXECUTE_FAILED is encountered
if (in.mode == ResultConstants.UPDATECOUNT) {
updateCounts[count++] = in.updateCount;
} else if (in.mode == ResultConstants.DATA) {
// FIXME: we don't have what it takes yet
// to differentiate between things like
// stored procedure calls to methods with
// void return type and select statements with
// a single row/column containg null
updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
} else {
updateCounts = ArrayUtil.arraySlice(updateCounts, 0, count);
break;
}
record = record.next;
}
out = new Result(ResultConstants.SQLEXECUTE, updateCounts, 0);
return out;
}
示例8: sqlExecuteBatch
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
private Result sqlExecuteBatch(Result cmd) {
int csid;
Record record;
Result out;
CompiledStatement cs;
Expression[] parameters;
int[] updateCounts;
int count;
csid = cmd.getStatementID();
cs = database.compiledStatementManager.getStatement(this, csid);
if (cs == null) {
// invalid sql has been removed already
return new Result(
Trace.runtimeError(Trace.INVALID_PREPARED_STATEMENT, null),
null);
}
parameters = cs.parameters;
count = 0;
updateCounts = new int[cmd.getSize()];
record = cmd.rRoot;
while (record != null) {
Result in;
Object[] pvals = record.data;
in = sqlExecuteCompiledNoPreChecks(cs, pvals);
// On the client side, iterate over the vals and throw
// a BatchUpdateException if a batch status value of
// esultConstants.EXECUTE_FAILED is encountered in the result
if (in.mode == ResultConstants.UPDATECOUNT) {
updateCounts[count++] = in.updateCount;
} else if (in.isData()) {
// FIXME: we don't have what it takes yet
// to differentiate between things like
// stored procedure calls to methods with
// void return type and select statements with
// a single row/column containg null
updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
} else {
updateCounts = ArrayUtil.arraySlice(updateCounts, 0, count);
break;
}
record = record.next;
}
out = new Result(ResultConstants.SQLEXECUTE, updateCounts, 0);
return out;
}
示例9: sqlExecuteBatchDirect
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
private Result sqlExecuteBatchDirect(Result cmd) {
Record record;
Result out;
int[] updateCounts;
int count;
count = 0;
updateCounts = new int[cmd.getSize()];
record = cmd.rRoot;
while (record != null) {
Result in;
String sql = (String) record.data[0];
try {
in = dbCommandInterpreter.execute(sql);
} catch (Throwable t) {
in = new Result(ResultConstants.ERROR);
// if (t instanceof OutOfMemoryError) {
// System.gc();
// }
// "in" alread equals "err"
// maybe test for OOME and do a gc() ?
// t.printStackTrace();
}
// On the client side, iterate over the colType vals and throw
// a BatchUpdateException if a batch status value of
// ResultConstants.EXECUTE_FAILED is encountered
if (in.mode == ResultConstants.UPDATECOUNT) {
updateCounts[count++] = in.updateCount;
} else if (in.isData()) {
// FIXME: we don't have what it takes yet
// to differentiate between things like
// stored procedure calls to methods with
// void return type and select statements with
// a single row/column containg null
updateCounts[count++] = ResultConstants.SUCCESS_NO_INFO;
} else {
updateCounts = ArrayUtil.arraySlice(updateCounts, 0, count);
break;
}
record = record.next;
}
out = new Result(ResultConstants.SQLEXECUTE, updateCounts, 0);
return out;
}