org.springframework.jdbc.core.JdbcTemplate.getQueryTimeout()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(151)

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

JdbcTemplate.getQueryTimeout介绍

[英]Return the query timeout for statements that this JdbcTemplate executes.
[中]返回此JdbcTemplate执行的语句的查询超时。

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Prepare the given JDBC Statement (or PreparedStatement or CallableStatement),
 * applying statement settings such as fetch size, max rows, and query timeout.
 * @param stmt the JDBC Statement to prepare
 * @throws SQLException if thrown by JDBC API
 * @see #setFetchSize
 * @see #setMaxRows
 * @see #setQueryTimeout
 * @see org.springframework.jdbc.datasource.DataSourceUtils#applyTransactionTimeout
 */
protected void applyStatementSettings(Statement stmt) throws SQLException {
  int fetchSize = getFetchSize();
  if (fetchSize != -1) {
    stmt.setFetchSize(fetchSize);
  }
  int maxRows = getMaxRows();
  if (maxRows != -1) {
    stmt.setMaxRows(maxRows);
  }
  DataSourceUtils.applyTimeout(stmt, getDataSource(), getQueryTimeout());
}

代码示例来源:origin: io.bufferslayer/buffer-spring-jdbc

public int getQueryTimeout() {
 return delegate.getQueryTimeout();
}

代码示例来源:origin: io.bufferslayer/bufferslayer-spring-jdbc

public int getQueryTimeout() {
 return delegate.getQueryTimeout();
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Prepare the given JDBC Statement (or PreparedStatement or CallableStatement),
 * applying statement settings such as fetch size, max rows, and query timeout.
 * @param stmt the JDBC Statement to prepare
 * @throws SQLException if thrown by JDBC API
 * @see #setFetchSize
 * @see #setMaxRows
 * @see #setQueryTimeout
 * @see org.springframework.jdbc.datasource.DataSourceUtils#applyTransactionTimeout
 */
protected void applyStatementSettings(Statement stmt) throws SQLException {
  int fetchSize = getFetchSize();
  if (fetchSize != -1) {
    stmt.setFetchSize(fetchSize);
  }
  int maxRows = getMaxRows();
  if (maxRows != -1) {
    stmt.setMaxRows(maxRows);
  }
  DataSourceUtils.applyTimeout(stmt, getDataSource(), getQueryTimeout());
}

代码示例来源:origin: org.springframework/org.springframework.jdbc

/**
 * Prepare the given JDBC Statement (or PreparedStatement or CallableStatement),
 * applying statement settings such as fetch size, max rows, and query timeout.
 * @param stmt the JDBC Statement to prepare
 * @throws SQLException if thrown by JDBC API
 * @see #setFetchSize
 * @see #setMaxRows
 * @see #setQueryTimeout
 * @see org.springframework.jdbc.datasource.DataSourceUtils#applyTransactionTimeout
 */
protected void applyStatementSettings(Statement stmt) throws SQLException {
  int fetchSize = getFetchSize();
  if (fetchSize > 0) {
    stmt.setFetchSize(fetchSize);
  }
  int maxRows = getMaxRows();
  if (maxRows > 0) {
    stmt.setMaxRows(maxRows);
  }
  DataSourceUtils.applyTimeout(stmt, getDataSource(), getQueryTimeout());
}

相关文章