title: Configuration of JTDS for use with HikariCP + Spring + MS SQL Server
body: <p>I kept googling for configuration of JTDS (1.3.1) for use with HikariCP (2.4.3), Spring (4.1.2), and MS SQL Server (2008), but unable to find a complete and working example.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>&lt;bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close"&gt;
      &lt;constructor-arg ref="hikariConfig" /&gt;
  &lt;/bean&gt; 
  
  &lt;bean id="hikariConfig" class="com.zaxxer.hikari.HikariConfig"&gt;
      &lt;property name="poolName" value="springHikariCP" /&gt;
      &lt;property name="connectionTestQuery" value="SELECT 1" /&gt;
      &lt;property name="dataSourceClassName" value="${jdbc.dataSourceClassName}" /&gt;
      &lt;property name="maximumPoolSize" value="${jdbc.maximumPoolSize}" /&gt;
      &lt;property name="minimumIdle" value="${jdbc.minimumIdle}" /&gt;
      &lt;property name="idleTimeout" value="${jdbc.idleTimeout}" /&gt;
      ....
      &lt;property name="dataSourceProperties"&gt;
          &lt;props&gt;
              ....
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Can anyone out there share the JTDS configs used in a production environment?</p>
  
  <p>Regards.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I found this SO post:</p>
  
  <p><a href="https://stackoverflow.com/questions/34739778/hikaricp-hanging-on-getconnection">HikariCP hanging on getConnection</a></p>
  
  <p>It seems that JTDS has a problem working with HikariCP. Actually, I have this problem too. Here is my complete config for JTDS:</p>
  
  <pre><code>&lt;bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close"&gt;
      &lt;constructor-arg ref="hikariConfig" /&gt;
  &lt;/bean&gt; 
  
  &lt;bean id="hikariConfig" class="com.zaxxer.hikari.HikariConfig"&gt;
      &lt;property name="poolName" value="springHikariCP" /&gt;
      &lt;property name="connectionTestQuery" value="${jdbc.connectionTestQuery}" /&gt;
      &lt;property name="dataSourceClassName" value="${jdbc.dataSourceClassName}" /&gt;
      &lt;property name="maximumPoolSize" value="${jdbc.maximumPoolSize}" /&gt;
      &lt;property name="minimumIdle" value="${jdbc.minimumIdle}" /&gt;
      &lt;property name="idleTimeout" value="${jdbc.idleTimeout}" /&gt;
      &lt;property name="connectionTimeout" value="${jdbc.connectionTimeout}" /&gt;
      &lt;property name="jdbcUrl" value="${jdbc.url}" /&gt;
      &lt;property name="dataSourceProperties"&gt;
          &lt;props&gt;
              &lt;prop key="user"&gt;${jdbc.username}&lt;/prop&gt;
              &lt;prop key="password"&gt;${jdbc.password}&lt;/prop&gt;
              &lt;prop key="cacheMetaData"&gt;${jtds.cacheMetaData}&lt;/prop&gt;                              
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>This is exactly the reason I posted my question, and I hope to see a complete example. However, at HikariCP's page, JTDS is listed as supported. I am confused.</p>