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

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

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

JdbcTemplate.setResultsMapCaseInsensitive介绍

[英]Set whether execution of a CallableStatement will return the results in a Map that uses case insensitive names for the parameters.
[中]设置CallableStatement的执行是否会在使用不区分大小写的参数名称的映射中返回结果。

代码示例

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

@Test
public void testCaseInsensitiveResultsMap() throws Exception {
  given(this.callableStatement.execute()).willReturn(false);
  given(this.callableStatement.getUpdateCount()).willReturn(-1);
  given(this.callableStatement.getObject(1)).willReturn("X");
  assertTrue("default should have been NOT case insensitive",
      !this.template.isResultsMapCaseInsensitive());
  this.template.setResultsMapCaseInsensitive(true);
  assertTrue("now it should have been set to case insensitive",
      this.template.isResultsMapCaseInsensitive());
  Map<String, Object> out = this.template.call(
      conn -> conn.prepareCall("my query"), Collections.singletonList(new SqlOutParameter("a", 12)));
  assertThat(out, instanceOf(LinkedCaseInsensitiveMap.class));
  assertNotNull("we should have gotten the result with upper case", out.get("A"));
  assertNotNull("we should have gotten the result with lower case", out.get("a"));
  verify(this.callableStatement).close();
  verify(this.connection).close();
}

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

public void setResultsMapCaseInsensitive(boolean resultsMapCaseInsensitive) {
 delegate.setResultsMapCaseInsensitive(resultsMapCaseInsensitive);
}

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

public void setResultsMapCaseInsensitive(boolean resultsMapCaseInsensitive) {
 delegate.setResultsMapCaseInsensitive(resultsMapCaseInsensitive);
}

代码示例来源:origin: stackoverflow.com

jt.setResultsMapCaseInsensitive(true);
sjc = new SimpleJdbcCall(jt)
    .withCatalogName("upclsch")

代码示例来源: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);
}

相关文章