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

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

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

JdbcTemplate.setSkipResultsProcessing介绍

[英]Set whether results processing should be skipped. Can be used to optimize callable statement processing when we know that no results are being passed back - the processing of out parameter will still take place. This can be used to avoid a bug in some older Oracle JDBC drivers like 10.1.0.2.
[中]设置是否应跳过结果处理。当我们知道没有结果被传回时,可以用来优化可调用语句的处理—out参数的处理仍然会进行。这可以用来避免一些旧的Oracle JDBC驱动程序(如10.1.0.2)中的错误。

代码示例

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

@Test
public void testStoredProcedureSkippingResultsProcessing() throws Exception {
  given(callableStatement.execute()).willReturn(true);
  given(callableStatement.getUpdateCount()).willReturn(-1);
  given(connection.prepareCall("{call " + StoredProcedureWithResultSetMapped.SQL + "()}")
      ).willReturn(callableStatement);
  JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
  jdbcTemplate.setSkipResultsProcessing(true);
  StoredProcedureWithResultSetMapped sproc = new StoredProcedureWithResultSetMapped(
      jdbcTemplate);
  Map<String, Object> res = sproc.execute();
  assertEquals("incorrect number of returns", 0, res.size());
}

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

public void setSkipResultsProcessing(boolean skipResultsProcessing) {
 delegate.setSkipResultsProcessing(skipResultsProcessing);
}

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

public void setSkipResultsProcessing(boolean skipResultsProcessing) {
 delegate.setSkipResultsProcessing(skipResultsProcessing);
}

代码示例来源:origin: fast-sql/FastSQL

/**
 * 创建一个SQL实例
 */
public SQL sql() {
  if (this.jdbcTemplate == null) {
    this.jdbcTemplate = new JdbcTemplate();
    this.jdbcTemplate.setIgnoreWarnings(ignoreWarnings);
    this.jdbcTemplate.setFetchSize(fetchSize);
    this.jdbcTemplate.setMaxRows(maxRows);
    this.jdbcTemplate.setQueryTimeout(queryTimeout);
    this.jdbcTemplate.setSkipResultsProcessing(skipResultsProcessing);
    this.jdbcTemplate.setSkipUndeclaredResults(skipUndeclaredResults);
    this.jdbcTemplate.setResultsMapCaseInsensitive(resultsMapCaseInsensitive);
    this.jdbcTemplate.setDataSource(this.dataSource);
  }
  return new SQL(this.jdbcTemplate, this.dataSourceType);
}

相关文章