本文整理汇总了Java中org.jooq.Cursor.close方法的典型用法代码示例。如果您正苦于以下问题:Java Cursor.close方法的具体用法?Java Cursor.close怎么用?Java Cursor.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jooq.Cursor
的用法示例。
在下文中一共展示了Cursor.close方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fetchList
import org.jooq.Cursor; //导入方法依赖的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: closeQuietly
import org.jooq.Cursor; //导入方法依赖的package包/类
/**
* Close the cursor quietly
*/
public static <R extends Record> void closeQuietly(Cursor<R> cursor) {
try {
if (cursor != null && !cursor.isClosed()) {
cursor.close();
log.debug("closed {}", cursor);
}
} catch (Exception e) {
log.debug(e.getMessage(), e);
}
}
示例3: testSimpleSelectAll
import org.jooq.Cursor; //导入方法依赖的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);
}
示例4: read
import org.jooq.Cursor; //导入方法依赖的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;
}
示例5: testSimpleSelectAll
import org.jooq.Cursor; //导入方法依赖的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);
}
示例6: read
import org.jooq.Cursor; //导入方法依赖的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;
}
示例7: testSimpleSelectAll
import org.jooq.Cursor; //导入方法依赖的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);
}
示例8: read
import org.jooq.Cursor; //导入方法依赖的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;
}