org.sonar.db.dialect.Dialect.getScrollDefaultFetchSize()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中org.sonar.db.dialect.Dialect.getScrollDefaultFetchSize()方法的一些代码示例,展示了Dialect.getScrollDefaultFetchSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dialect.getScrollDefaultFetchSize()方法的具体详情如下:
包路径:org.sonar.db.dialect.Dialect
类名称:Dialect
方法名:getScrollDefaultFetchSize

Dialect.getScrollDefaultFetchSize介绍

[英]Fetch size to be used when scrolling large result sets.
[中]滚动大型结果集时要使用的获取大小。

代码示例

代码示例来源:origin: SonarSource/sonarqube

public static SelectImpl create(Database db, Connection connection, String sql) throws SQLException {
  // TODO use DbClient#newScrollingSelectStatement()
  PreparedStatement pstmt = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
  pstmt.setFetchSize(db.getDialect().getScrollDefaultFetchSize());
  return new SelectImpl(pstmt);
 }
}

代码示例来源:origin: SonarSource/sonarqube

/**
 * Create a PreparedStatement for SELECT requests with scrolling of results
 */
public PreparedStatement newScrollingSelectStatement(DbSession session, String sql) {
 int fetchSize = database.getDialect().getScrollDefaultFetchSize();
 return newScrollingSelectStatement(session, sql, fetchSize);
}

代码示例来源:origin: SonarSource/sonarqube

MyBatisConfBuilder(Database database) {
 this.conf = new Configuration();
 this.conf.setEnvironment(new Environment("production", createTransactionFactory(), database.getDataSource()));
 this.conf.setUseGeneratedKeys(true);
 this.conf.setLazyLoadingEnabled(false);
 this.conf.setJdbcTypeForNull(JdbcType.NULL);
 Dialect dialect = database.getDialect();
 this.conf.setDatabaseId(dialect.getId());
 this.conf.getVariables().setProperty("_true", dialect.getTrueSqlValue());
 this.conf.getVariables().setProperty("_false", dialect.getFalseSqlValue());
 this.conf.getVariables().setProperty("_from_dual", dialect.getSqlFromDual());
 this.conf.getVariables().setProperty("_scrollFetchSize", String.valueOf(dialect.getScrollDefaultFetchSize()));
 this.conf.setLocalCacheScope(LocalCacheScope.STATEMENT);
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-db-migration

public static SelectImpl create(Database db, Connection connection, String sql) throws SQLException {
  // TODO use DbClient#newScrollingSelectStatement()
  PreparedStatement pstmt = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
  pstmt.setFetchSize(db.getDialect().getScrollDefaultFetchSize());
  return new SelectImpl(pstmt);
 }
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-db

/**
 * Create a PreparedStatement for SELECT requests with scrolling of results
 */
public PreparedStatement newScrollingSelectStatement(DbSession session, String sql) {
 int fetchSize = database.getDialect().getScrollDefaultFetchSize();
 return newScrollingSelectStatement(session, sql, fetchSize);
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-db

public MyBatisConfBuilder(Database database) {
 this.conf = new Configuration();
 this.conf.setEnvironment(new Environment("production", createTransactionFactory(), database.getDataSource()));
 this.conf.setUseGeneratedKeys(true);
 this.conf.setLazyLoadingEnabled(false);
 this.conf.setJdbcTypeForNull(JdbcType.NULL);
 Dialect dialect = database.getDialect();
 this.conf.setDatabaseId(dialect.getId());
 this.conf.getVariables().setProperty("_true", dialect.getTrueSqlValue());
 this.conf.getVariables().setProperty("_false", dialect.getFalseSqlValue());
 this.conf.getVariables().setProperty("_scrollFetchSize", String.valueOf(dialect.getScrollDefaultFetchSize()));
 this.conf.setLocalCacheScope(LocalCacheScope.STATEMENT);
}

相关文章