本文整理汇总了Java中org.jooq.ResultQuery.fetchLazy方法的典型用法代码示例。如果您正苦于以下问题:Java ResultQuery.fetchLazy方法的具体用法?Java ResultQuery.fetchLazy怎么用?Java ResultQuery.fetchLazy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jooq.ResultQuery
的用法示例。
在下文中一共展示了ResultQuery.fetchLazy方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fetchList
import org.jooq.ResultQuery; //导入方法依赖的package包/类
private List<String> fetchList (ResultQuery<Record1<String>> query, String columnField) {
Cursor<Record1<String>> cursor = null;
List<String> result = new ArrayList<String> (1000);
try {
cursor = query.fetchLazy ();
// Cursor has similar methods as Iterator<R>
while (cursor.hasNext ()) {
Record record = cursor.fetchOne ();
String sValue = (String) record.getValue (columnField);
result.add (sValue);
}
} finally {
if (cursor != null) {
cursor.close ();
}
}
return result;
}
示例2: testSimpleSelectAll
import org.jooq.ResultQuery; //导入方法依赖的package包/类
@Test
@Ignore @SuppressWarnings("unused")
public void testSimpleSelectAll () {
Table<Record> table = tableByName (tsvFileName);
long startTime = System.nanoTime ();
int count = 0;
ResultQuery<Record> query = context.selectFrom (table);
// log.debug ("PresetValuesFlatTable sql:"+query.getSQL ());
Cursor<Record> cursor = null;
try {
cursor = query.fetchLazy ();
// Cursor has similar methods as Iterator<R>
while (cursor.hasNext ()) {
Record record = cursor.fetchOne ();
for (Field<?> columnField : record.fields ()) {
String value = (String) record.getValue (columnField);
count++;
}
}
} finally {
if (cursor != null) {
cursor.close ();
}
}
long endTime = System.nanoTime ();
long duration = endTime - startTime;
log.debug ("flat-count:" + count + ", duration: " + duration);
}
示例3: read
import org.jooq.ResultQuery; //导入方法依赖的package包/类
private int read (ResultQuery<Record> query) {
Cursor<Record> cursor = null;
int count = 0;
try {
cursor = query.fetchLazy ();
// Cursor has similar methods as Iterator<R>
while (cursor.hasNext ()) {
Record record = cursor.fetchOne ();
for (Field<?> columnField : record.fields ()) {
String sValue = (String) record.getValue (columnField);
@SuppressWarnings("unused") double value = NaN;
if ("Inf".equalsIgnoreCase (sValue))
value = POSITIVE_INFINITY;
else if ("-Inf".equalsIgnoreCase (sValue))
value = NEGATIVE_INFINITY;
else if ("NA".equalsIgnoreCase (sValue))
value = NaN;
else if ("null".equalsIgnoreCase (sValue))
value = NaN;
else if (sValue == null)
value = NaN;
else
value = Double.parseDouble (sValue);
count++;
}
}
} finally {
if (cursor != null) {
cursor.close ();
}
}
return count;
}
示例4: testSimpleSelectAll
import org.jooq.ResultQuery; //导入方法依赖的package包/类
@Test @Ignore @SuppressWarnings("unused")
public void testSimpleSelectAll () {
String tsvFileName="LGG.AgilentG4502A_07_3.Level_2.tsv";
Table<Record> table = tableByName (tsvFileName);
long startTime = System.nanoTime();
int count=0;
ResultQuery<Record> query =context.selectFrom (table);
// log.debug ("PresetValuesFlatTable sql:"+query.getSQL ());
Cursor<Record> cursor = null;
try {
cursor = query.fetchLazy();
// Cursor has similar methods as Iterator<R>
while (cursor.hasNext()) {
Record record = cursor.fetchOne();
for(Field<?> columnField: record.fields()){
String value = (String)record.getValue (columnField);
count++;
}
}
}finally {
if (cursor != null) {cursor.close();}
}
long endTime = System.nanoTime();
long duration = endTime - startTime;
log.debug ("flat-count:"+count+", duration: "+duration);
}
示例5: read
import org.jooq.ResultQuery; //导入方法依赖的package包/类
private int read(ResultQuery<Record> query){
Cursor<Record> cursor = null;
int count=0;
try {
cursor = query.fetchLazy();
// Cursor has similar methods as Iterator<R>
while (cursor.hasNext()) {
Record record = cursor.fetchOne();
for(Field<?> columnField: record.fields()){
String sValue = (String)record.getValue (columnField);
@SuppressWarnings("unused") double value=NaN;
if ("Inf".equalsIgnoreCase (sValue))
value = POSITIVE_INFINITY;
else if ("-Inf".equalsIgnoreCase (sValue))
value = NEGATIVE_INFINITY;
else if ("NA".equalsIgnoreCase (sValue))
value = NaN;
else if ("null".equalsIgnoreCase (sValue))
value = NaN;
else if (sValue==null)
value = NaN;
else
value = Double.parseDouble (sValue);
count++;
}
}
}finally {
if (cursor != null) {cursor.close();}
}
return count;
}
示例6: testSimpleSelectAll
import org.jooq.ResultQuery; //导入方法依赖的package包/类
@Test
@Ignore @SuppressWarnings("unused")
public void testSimpleSelectAll () {
Table<Record> table = tableByName (tsvFileName);
long startTime = System.nanoTime ();
int count = 0;
ResultQuery<Record> query = context.selectFrom (table);
// log.debug ("PresetValuesFlatTable sql:"+query.getSQL ());
Cursor<Record> cursor = null;
try {
cursor = query.fetchLazy ();
// Cursor has similar methods as Iterator<R>
while (cursor.hasNext ()) {
Record record = cursor.fetchOne ();
for (Field<?> columnField : record.fields ()) {
String value = (String) record.getValue (columnField);
count++;
}
}
} finally {
if (cursor != null) {
cursor.close ();
}
}
long endTime = System.nanoTime ();
long duration = endTime - startTime;
log.debug ("flat-count:" + count + ", duration: " + duration);
}
示例7: read
import org.jooq.ResultQuery; //导入方法依赖的package包/类
@SuppressWarnings("unused")
private int read (ResultQuery<Record> query) {
Cursor<Record> cursor = null;
int count = 0;
try {
cursor = query.fetchLazy ();
// Cursor has similar methods as Iterator<R>
while (cursor.hasNext ()) {
Record record = cursor.fetchOne ();
for (Field<?> columnField : record.fields ()) {
String sValue = (String) record.getValue (columnField);
double value = NaN;
if ("Inf".equalsIgnoreCase (sValue))
value = POSITIVE_INFINITY;
else if ("-Inf".equalsIgnoreCase (sValue))
value = NEGATIVE_INFINITY;
else if ("NA".equalsIgnoreCase (sValue))
value = NaN;
else if ("null".equalsIgnoreCase (sValue))
value = NaN;
else if (sValue == null)
value = NaN;
else
value = Double.parseDouble (sValue);
count++;
}
}
} finally {
if (cursor != null) {
cursor.close ();
}
}
return count;
}
示例8: openCursor
import org.jooq.ResultQuery; //导入方法依赖的package包/类
private Cursor<Record> openCursor(){
Timer timer = Timer.start ("open-cursor");
Cursor<Record> cursor;
ResultQuery<Record> query=null;
try{
// query = queryHelper.queryAllRows (fieldList, table);
query = queryHelper.queryINRows (fieldList, rows.keys (), table);
cursor = query.fetchLazy ();
}finally{
if(query!=null) query.close();
}
timer.read ();
return cursor;
}