本文整理汇总了Java中org.hsqldb.result.ResultMetaData.newResultMetaData方法的典型用法代码示例。如果您正苦于以下问题:Java ResultMetaData.newResultMetaData方法的具体用法?Java ResultMetaData.newResultMetaData怎么用?Java ResultMetaData.newResultMetaData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.result.ResultMetaData
的用法示例。
在下文中一共展示了ResultMetaData.newResultMetaData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createResultMetaData
import org.hsqldb.result.ResultMetaData; //导入方法依赖的package包/类
private void createResultMetaData(Session session) {
resultMetaData = ResultMetaData.newResultMetaData(resultColumnTypes,
columnMap, indexLimitVisible, indexLimitRowId);
for (int i = 0; i < indexLimitVisible; i++) {
Expression e = exprColumns[i];
ColumnSchema tableColumn = null;
ColumnBase column;
tableColumn = e.getColumn();
resultMetaData.columnTypes[i] = e.getDataType();
if (tableColumn == null) {
column = new ColumnBase();
} else {
column = new ColumnBase(session.database.getCatalogName().name,
tableColumn);
}
column.setType(e.getDataType());
resultMetaData.columns[i] = column;
resultMetaData.columnLabels[i] = e.getAlias();
}
}
示例2: newEmptyResultSet
import org.hsqldb.result.ResultMetaData; //导入方法依赖的package包/类
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);
}
示例3: newEptyResultSet
import org.hsqldb.result.ResultMetaData; //导入方法依赖的package包/类
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);
}
示例4: getResultMetaData
import org.hsqldb.result.ResultMetaData; //导入方法依赖的package包/类
public ResultMetaData getResultMetaData() {
if (resultMetaData != null) {
return resultMetaData;
}
switch (type) {
case StatementTypes.CALL : {
if (expression == null) {
return ResultMetaData.emptyResultMetaData;
}
// TODO:
//
// 1.) standard to register metadata for columns of
// the primary result set, if any, generated by call
//
// 2.) Represent the return value, if any (which is
// not, in truth, a result set), as an OUT parameter
//
// For now, I've reverted a bunch of code I had in place
// and instead simply reflect things as the are, describing
// a single column result set that communicates
// the return value. If the expression generating the
// return value has a void return type, a result set
// is described whose single column is of type NULL
ResultMetaData md = ResultMetaData.newResultMetaData(1);
ColumnBase column =
new ColumnBase(null, null, null,
StatementDMQL.RETURN_COLUMN_NAME);
column.setType(expression.getDataType());
md.columns[0] = column;
md.prepareData();
resultMetaData = md;
return md;
}
default :
throw Error.runtimeError(ErrorCode.U_S0500,
"StatementProcedure");
}
}
示例5: getResultMetaData
import org.hsqldb.result.ResultMetaData; //导入方法依赖的package包/类
public ResultMetaData getResultMetaData() {
if (resultMetaData != null) {
return resultMetaData;
}
switch (type) {
case StatementTypes.CALL : {
if (expression == null) {
return ResultMetaData.emptyResultMetaData;
}
// TODO:
//
// 1.) standard to register metadata for columns of
// the primary result set, if any, generated by call
//
// 2.) Represent the return value, if any (which is
// not, in truth, a result set), as an OUT parameter
//
// For now, I've reverted a bunch of code I had in place
// and instead simply reflect things as the are, describing
// a single column result set that communicates
// the return value. If the expression generating the
// return value has a void return type, a result set
// is described whose single column is of type NULL
ResultMetaData md = ResultMetaData.newResultMetaData(1);
ColumnBase column =
new ColumnBase(null, null, null,
StatementDMQL.RETURN_COLUMN_NAME);
column.setType(expression.getDataType());
md.columns[0] = column;
md.prepareData();
resultMetaData = md;
return md;
}
default :
throw Error.runtimeError(
ErrorCode.U_S0500,
"CompiledStatement.getResultMetaData()");
}
}
示例6: setGeneratedColumnInfo
import org.hsqldb.result.ResultMetaData; //导入方法依赖的package包/类
/**
* For the creation of the statement
*/
public void setGeneratedColumnInfo(int generate, ResultMetaData meta) {
// can support INSERT_SELECT also
if (type != StatementTypes.INSERT) {
return;
}
int colIndex = baseTable.getIdentityColumnIndex();
if (colIndex == -1) {
return;
}
switch (generate) {
case ResultConstants.RETURN_NO_GENERATED_KEYS :
return;
case ResultConstants.RETURN_GENERATED_KEYS_COL_INDEXES :
int[] columnIndexes = meta.getGeneratedColumnIndexes();
if (columnIndexes.length != 1) {
return;
}
if (columnIndexes[0] != colIndex) {
return;
}
// fall through
case ResultConstants.RETURN_GENERATED_KEYS :
generatedIndexes = new int[]{ colIndex };
break;
case ResultConstants.RETURN_GENERATED_KEYS_COL_NAMES :
String[] columnNames = meta.getGeneratedColumnNames();
if (columnNames.length != 1) {
return;
}
if (baseTable.findColumn(columnNames[0]) != colIndex) {
return;
}
generatedIndexes = new int[]{ colIndex };
break;
}
generatedResultMetaData =
ResultMetaData.newResultMetaData(generatedIndexes.length);
for (int i = 0; i < generatedIndexes.length; i++) {
ColumnSchema column = baseTable.getColumn(generatedIndexes[i]);
generatedResultMetaData.columns[i] = column;
}
generatedResultMetaData.prepareData();
}