本文整理汇总了Java中org.hsqldb.types.Type.SQL_INTEGER属性的典型用法代码示例。如果您正苦于以下问题:Java Type.SQL_INTEGER属性的具体用法?Java Type.SQL_INTEGER怎么用?Java Type.SQL_INTEGER使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.hsqldb.types.Type
的用法示例。
在下文中一共展示了Type.SQL_INTEGER属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveTypes
public void resolveTypes(Session session, Expression parent) {
for (int i = 0; i < nodes.length; i++) {
if (nodes[i] != null) {
nodes[i].resolveTypes(session, this);
}
}
if (nodes[LEFT].dataType == null) {
throw Error.error(ErrorCode.X_42567);
}
if (!nodes[LEFT].dataType.isArrayType()) {
throw Error.error(ErrorCode.X_42563);
}
dataType = nodes[LEFT].dataType.collectionBaseType();
if (nodes[RIGHT].opType == OpTypes.DYNAMIC_PARAM) {
nodes[RIGHT].dataType = Type.SQL_INTEGER;
}
}
示例2: compileCreateSequence
StatementSchema compileCreateSequence() {
read();
Boolean ifNotExists = readIfNotExists();
/*
CREATE SEQUENCE <name>
[AS {INTEGER | BIGINT}]
[START WITH <value>]
[INCREMENT BY <value>]
*/
HsqlName name = readNewSchemaObjectName(SchemaObject.SEQUENCE, false);
NumberSequence sequence = new NumberSequence(name, Type.SQL_INTEGER);
readSequenceOptions(sequence, true, false, false);
String sql = getLastPart();
Object[] args = new Object[] {
sequence, ifNotExists
};
HsqlName[] writeLockNames = database.schemaManager.catalogNameArray;
return new StatementSchema(sql, StatementTypes.CREATE_SEQUENCE, args,
null, writeLockNames);
}
示例3: getFunctionExpression
public Expression getFunctionExpression() {
switch (funcType) {
case FUNC_SYSDATE : {
FunctionSQL f = new FunctionSQL(FUNC_CURRENT_TIMESTAMP);
f.nodes = new Expression[]{
new ExpressionValue(ValuePool.INTEGER_0,
Type.SQL_INTEGER) };
return f;
}
case FUNC_CONCAT :
return new ExpressionArithmetic(OpTypes.CONCAT,
nodes[Expression.LEFT],
nodes[Expression.RIGHT]);
}
return super.getFunctionExpression();
}
示例4: compileCreateSequence
StatementSchema compileCreateSequence() {
read();
/*
* CREATE SEQUENCE <name> [AS {INTEGER | BIGINT}] [START WITH <value>]
* [INCREMENT BY <value>]
*/
HsqlName name = readNewSchemaObjectNameNoCheck(SchemaObject.SEQUENCE);
NumberSequence sequence = new NumberSequence(name, Type.SQL_INTEGER);
readSequenceOptions(sequence, true, false);
String sql = getLastPart();
Object[] args = new Object[] { sequence };
return new StatementSchema(sql, StatementTypes.CREATE_SEQUENCE, args, null, null);
}
示例5: ExpressionColumn
ExpressionColumn(int type) {
super(type);
if (type == OpTypes.DYNAMIC_PARAM) {
isParam = true;
} else if (type == OpTypes.ROWNUM) {
columnName = rownumName.name;
dataType = Type.SQL_INTEGER;
}
}
示例6: newEmptyResultSet
public static JDBCResultSet newEmptyResultSet() {
ResultMetaData md = ResultMetaData.newResultMetaData(1);
ColumnBase column =
new ColumnBase(null, null, null, "C1");
column.setType(Type.SQL_INTEGER);
md.columnTypes[0] = Type.SQL_INTEGER;
md.columns[0] = column;
Result r = Result.newSingleColumnResult(md);
return newJDBCResultSet(r, md);
}
示例7: newLookupTable
static Table newLookupTable(Database database) {
try {
TableDerived table = TableUtil.newSubqueryTable(database, null);
ColumnSchema column = new ColumnSchema(HsqlNameManager.getAutoColumnName(0), Type.SQL_INTEGER, false, true, null);
table.addColumn(column);
table.createPrimaryKey(new int[] { 0 });
return table;
} catch (HsqlException e) {
return null;
}
}
示例8: newEptyResultSet
public static JDBCResultSet newEptyResultSet() {
ResultMetaData md = ResultMetaData.newResultMetaData(1);
ColumnBase column =
new ColumnBase(null, null, null, "C1");
column.setType(Type.SQL_INTEGER);
md.columnTypes[0] = Type.SQL_INTEGER;
md.columns[0] = column;
Result r = Result.newSingleColumnResult(md);
return newJDBCResultSet(r, md);
}
示例9: resolveTypes
public void resolveTypes(Session session, Expression parent) {
for (int i = 0; i < nodes.length; i++) {
if (nodes[i] != null) {
nodes[i].resolveTypes(session, this);
}
}
if (nodes.length == 1) {
if (nodes[LEFT].dataType.isRowType()) {
if (ordinality) {
throw Error.error(ErrorCode.X_42581, Tokens.T_ORDINALITY);
}
nodeDataTypes =
((RowType) nodes[LEFT].dataType).getTypesArray();
table.prepareTable(session);
table.columnList =
((FunctionSQLInvoked) nodes[LEFT]).routine.getTable()
.columnList;
isTable = true;
return;
}
}
for (int i = 0; i < nodes.length; i++) {
if (!nodes[i].dataType.isArrayType()) {
throw Error.error(ErrorCode.X_42563, Tokens.T_UNNEST);
}
}
int columnCount = ordinality ? nodes.length + 1
: nodes.length;
nodeDataTypes = new Type[columnCount];
for (int i = 0; i < nodes.length; i++) {
nodeDataTypes[i] = nodes[i].dataType.collectionBaseType();
if (nodeDataTypes[i] == null
|| nodeDataTypes[i] == Type.SQL_ALL_TYPES) {
throw Error.error(ErrorCode.X_42567, Tokens.T_UNNEST);
}
}
if (ordinality) {
nodeDataTypes[nodes.length] = Type.SQL_INTEGER;
}
table.prepareTable(session);
}
示例10: newBatchedExecuteResponse
/**
* For BATCHEXERESPONSE for a BATCHEXECUTE or BATCHEXECDIRECT
*/
public static Result newBatchedExecuteResponse(int[] updateCounts,
Result generatedResult, Result e) {
Result result = newResult(ResultConstants.BATCHEXECRESPONSE);
result.addChainedResult(generatedResult);
result.addChainedResult(e);
Type[] types = new Type[]{ Type.SQL_INTEGER };
result.metaData = ResultMetaData.newSimpleResultMetaData(types);
Object[][] table = new Object[updateCounts.length][];
for (int i = 0; i < updateCounts.length; i++) {
table[i] = new Object[]{ ValuePool.getInt(updateCounts[i]) };
}
((RowSetNavigatorClient) result.navigator).setData(table);
return result;
}
示例11: resolveTypes
public void resolveTypes(Session session, Expression parent) {
for (int i = 0; i < nodes.length; i++) {
if (nodes[i] != null) {
nodes[i].resolveTypes(session, this);
}
}
if (nodes.length == 1) {
if (nodes[LEFT].dataType.isRowType()) {
if (ordinality) {
throw Error.error(ErrorCode.X_42581, Tokens.T_ORDINALITY);
}
nodeDataTypes =
((RowType) nodes[LEFT].dataType).getTypesArray();
table.prepareTable();
table.columnList =
((FunctionSQLInvoked) nodes[LEFT]).routine.getTable()
.columnList;
isTable = true;
return;
}
}
for (int i = 0; i < nodes.length; i++) {
if (!nodes[i].dataType.isArrayType()) {
throw Error.error(ErrorCode.X_42563, Tokens.T_UNNEST);
}
}
int columnCount = ordinality ? nodes.length + 1
: nodes.length;
nodeDataTypes = new Type[columnCount];
for (int i = 0; i < nodes.length; i++) {
nodeDataTypes[i] = nodes[i].dataType.collectionBaseType();
if (nodeDataTypes[i] == null
|| nodeDataTypes[i] == Type.SQL_ALL_TYPES) {
throw Error.error(ErrorCode.X_42567, Tokens.T_UNNEST);
}
}
if (ordinality) {
nodeDataTypes[nodes.length] = Type.SQL_INTEGER;
}
table.prepareTable();
}
示例12: XreadLimit
private void XreadLimit(SortAndSlice sortAndSlice) {
Expression e1 = null;
Expression e2 = null;
if (token.tokenType == Tokens.OFFSET) {
read();
e1 = XreadSimpleValueSpecificationOrNull();
if (e1 == null) {
throw Error.error(ErrorCode.X_42565, ErrorCode.INVALID_LIMIT);
}
}
if (token.tokenType == Tokens.LIMIT) {
read();
e2 = XreadSimpleValueSpecificationOrNull();
if (e2 == null) {
throw Error.error(ErrorCode.X_42565, ErrorCode.INVALID_LIMIT);
}
if (e1 == null && token.tokenType == Tokens.OFFSET) {
read();
e1 = XreadSimpleValueSpecificationOrNull();
}
} else if (token.tokenType == Tokens.FETCH) {
read();
if (token.tokenType == Tokens.FIRST
|| token.tokenType == Tokens.NEXT) {
read();
}
e2 = XreadSimpleValueSpecificationOrNull();
if (e2 == null) {
e2 = new ExpressionValue(ValuePool.INTEGER_1,
Type.SQL_INTEGER);
}
if (token.tokenType == Tokens.ROW
|| token.tokenType == Tokens.ROWS) {
read();
}
readThis(Tokens.ONLY);
}
if (e1 == null) {
e1 = new ExpressionValue(ValuePool.INTEGER_0, Type.SQL_INTEGER);
}
boolean valid = true;
if (e1.isParam()) {
e1.setDataType(session, Type.SQL_INTEGER);
} else {
valid = (e1.getDataType().typeCode == Types.SQL_INTEGER
&& ((Integer) e1.getValue(null)).intValue() >= 0);
}
if (e2.isParam()) {
e2.setDataType(session, Type.SQL_INTEGER);
} else {
valid &= (e2.getDataType().typeCode == Types.SQL_INTEGER
&& ((Integer) e2.getValue(null)).intValue() >= 0);
}
if (valid) {
sortAndSlice.addLimitCondition(new ExpressionOp(OpTypes.LIMIT, e1,
e2));
return;
}
throw Error.error(ErrorCode.X_42565, ErrorCode.INVALID_LIMIT);
}
示例13: compileCreateSequence
StatementSchema compileCreateSequence() {
read();
boolean ifNot = false;
if (token.tokenType == Tokens.IF) {
int position = getPosition();
read();
if (token.tokenType == Tokens.NOT) {
read();
readThis(Tokens.EXISTS);
ifNot = true;
} else {
rewind(position);
}
}
/*
CREATE SEQUENCE <name>
[AS {INTEGER | BIGINT}]
[START WITH <value>]
[INCREMENT BY <value>]
*/
HsqlName name = readNewSchemaObjectName(SchemaObject.SEQUENCE, false);
NumberSequence sequence = new NumberSequence(name, Type.SQL_INTEGER);
readSequenceOptions(sequence, true, false, false);
String sql = getLastPart();
Object[] args = new Object[] {
sequence, Boolean.valueOf(ifNot)
};
HsqlName[] writeLockNames = database.schemaManager.catalogNameArray;
return new StatementSchema(sql, StatementTypes.CREATE_SEQUENCE, args,
null, writeLockNames);
}