本文整理汇总了Java中org.apache.calcite.avatica.util.Cursor.Accessor方法的典型用法代码示例。如果您正苦于以下问题:Java Cursor.Accessor方法的具体用法?Java Cursor.Accessor怎么用?Java Cursor.Accessor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.avatica.util.Cursor
的用法示例。
在下文中一共展示了Cursor.Accessor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAccessor
import org.apache.calcite.avatica.util.Cursor; //导入方法依赖的package包/类
/**
* Returns the accessor for column with a given index.
*
* @param columnIndex 1-based column index
* @return Accessor
* @throws SQLException if index is not valid
*/
private Cursor.Accessor getAccessor(int columnIndex) throws SQLException {
try {
return accessorList.get(columnIndex - 1);
} catch (IndexOutOfBoundsException e) {
throw new SQLException("invalid column ordinal: " + columnIndex);
}
}
示例2: getObject
import org.apache.calcite.avatica.util.Cursor; //导入方法依赖的package包/类
@Override
public Object getObject( int columnIndex ) throws SQLException {
throwIfClosed();
final Cursor.Accessor accessor;
try {
accessor = accessorList.get(columnIndex - 1);
} catch (IndexOutOfBoundsException e) {
throw new SQLException("invalid column ordinal: " + columnIndex);
}
final ColumnMetaData metaData = columnMetaDataList.get(columnIndex - 1);
// Dremio returns a float (4bytes) for a SQL Float whereas Calcite would return a double (8bytes)
int typeId = (metaData.type.id != Types.FLOAT) ? metaData.type.id : Types.REAL;
return AvaticaSite.get(accessor, typeId, localCalendar);
}
示例3: getObject
import org.apache.calcite.avatica.util.Cursor; //导入方法依赖的package包/类
@Override
public Object getObject( int columnIndex ) throws SQLException {
throwIfClosed();
final Cursor.Accessor accessor;
try {
accessor = accessorList.get(columnIndex - 1);
} catch (IndexOutOfBoundsException e) {
throw new SQLException("invalid column ordinal: " + columnIndex);
}
final ColumnMetaData metaData = columnMetaDataList.get(columnIndex - 1);
// Drill returns a float (4bytes) for a SQL Float whereas Calcite would return a double (8bytes)
int typeId = (metaData.type.id != Types.FLOAT) ? metaData.type.id : Types.REAL;
return AvaticaSite.get(accessor, typeId, localCalendar);
}
示例4: getObject
import org.apache.calcite.avatica.util.Cursor; //导入方法依赖的package包/类
public Object getObject(int columnIndex) throws SQLException {
final Cursor.Accessor accessor = getAccessor(columnIndex);
final ColumnMetaData metaData = columnMetaDataList.get(columnIndex - 1);
return AvaticaSite.get(accessor, metaData.type.id, localCalendar);
}