title: Setting SQL statement parameter value: column index 1, parameter value [name], value class [java.lang.String], SQL type unknown
body: <p>I am passing parameters to Query using NamedParameterJdbcTemplate . But am getting trace details as a warning and parameter binding is not showing.Main problem for is it is showing the executing sql but I want parameter also part of it but only ?(question mark) comes.After the warning binding happens and execution is good but binding is not visible in log.Please help me to check this.</p>
  
  <blockquote>
    <p>column index 1, parameter value [mike], value class
    [java.lang.String], SQL type unknown 
    column index 2, parameter value
    [1], value class [java.lang.Integer], SQL type unknown</p>
  </blockquote>
  
  <p><strong>Repository:</strong></p>
  
  <pre><code>@Repository
  public class DataRepository {
      private static Logger log = LoggerFactory.getLogger(DataRepository.class);
  
      @Autowired
      private NamedParameterJdbcTemplate jdbcTemplate;
  
      public Data findDataObjet() throws Exception {
  
          Map&lt;String, Object&gt; parameters = new HashMap&lt;&gt;();
          parameters.put("id1", "mike");
          parameters.put("id2", new Long(1));
  
          String sqlString = "select * from table1 where id1 = ":id1" and id2 = :id2";
  
          Data extObj = jdbcTemplate.query(sqlString, parameters, (rs) -&gt; {
              if (rs != null &amp;&amp; rs.next()) {
                  Data innerObj = new Data();
                  innerObj.setName(rs.getString("name"));             
                  return innerObj;
              } else {
                  log.info("No records found:"+rs);
                  return null;
              }
          });
  
          return extObj;
  
      }
  }
  </code></pre>
  
  <p><strong>application.properties:</strong></p>
  
  <pre><code>spring.datasource.url=url
  spring.datasource.username=user
  spring.datasource.password=password
  spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
  
  spring.datasource.type = com.zaxxer.hikari.HikariDataSource
  spring.datasource.hikari.connection-timeout=60000
  spring.datasource.hikari.maximum-pool-size=2
  </code></pre>
  
  <p><strong>logback-spring.xml:</strong></p>
  
  <pre><code>&lt;springProfile name="dev"&gt;
          &lt;logger name="org.springframework.jdbc.core.JdbcTemplate"&gt;
              &lt;level value="trace" /&gt;
          &lt;/logger&gt;
          &lt;logger name="org.springframework.jdbc.core.StatementCreatorUtils"&gt;
              &lt;level value="trace" /&gt;
          &lt;/logger&gt;
          &lt;appender name="dailyRollingFileAppender"
              class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
              &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
                  &lt;FileNamePattern&gt;${logsPath}TSYS2DM%d{MMddyyyy}.log
                  &lt;/FileNamePattern&gt;
                  &lt;maxHistory&gt;4&lt;/maxHistory&gt;
              &lt;/rollingPolicy&gt;
  
              &lt;encoder&gt;
                  &lt;Pattern&gt;%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level
                      %logger{35}-%msg %n&lt;/Pattern&gt;
              &lt;/encoder&gt;
  
          &lt;/appender&gt;
          &lt;root level="INFO"&gt;
              &lt;appender-ref ref="dailyRollingFileAppender" /&gt;
          &lt;/root&gt;
      &lt;/springProfile&gt;
  </code></pre>
  
  <p><strong>Log Trace:</strong></p>
  
  <pre><code>2018-03-07 12:19:42.888 DEBUG 30224 --- [resources/input] o.s.jdbc.core.JdbcTemplate               : Executing prepared SQL query
  2018-03-07 12:19:42.889 DEBUG 30224 --- [resources/input] o.s.jdbc.core.JdbcTemplate               : Executing prepared SQL statement [ select * from table1 where id1 = "?" and id2 = ?;]
  2018-03-07 12:19:43.132 TRACE 30224 --- [resources/input] o.s.jdbc.core.StatementCreatorUtils      : Setting SQL statement parameter value: column index 1, parameter value [mike], value class [java.lang.String], SQL type unknown
  2018-03-07 12:19:43.132 TRACE 30224 --- [resources/input] o.s.jdbc.core.StatementCreatorUtils      : Setting SQL statement parameter value: column index 2, parameter value [1], value class [java.lang.Integer], SQL type unknown
  2018-03-07 12:19:43.439  INFO 30224 --- [resources/input] c.t.f.c.t.t.db.TRMAccountDataRepository  : found record with cnsmr_id:1234
  </code></pre>