当前位置: 首页>>代码示例>>Java>>正文


Java Cursor.close方法代码示例

本文整理汇总了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;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:19,代码来源:TestJooqCursorLUSCLevel2.java

示例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);
  }
}
 
开发者ID:Trunkplatform,项目名称:tiny-rxjava-jdbc,代码行数:14,代码来源:Util.java

示例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);
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:31,代码来源:TestJooqCursorLUSCLevel2.java

示例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;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:34,代码来源:TestJooqCursorLUSCLevel2.java

示例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);
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:29,代码来源:TestJooqCursorLGGLevel2.java

示例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;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:32,代码来源:TestJooqCursorLGGLevel2.java

示例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);
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:31,代码来源:TestJooqCursorGBMLevel2.java

示例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;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:35,代码来源:TestJooqCursorGBMLevel2.java


注:本文中的org.jooq.Cursor.close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。