title: Spring datasource connection to MS SQL Server named instance
body: <p>I am getting an error when trying to create a datasource connection to MS SQL server named instance using JTDS driver within my Spring Config.</p>
  
  <p>My spring datasource configuration is :</p>
  
  <pre><code>&lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
      &lt;property name="driverClassName" value="${db.driver}" /&gt;
      &lt;property name="url" value="${db.jdbcurl}" /&gt;
      &lt;property name="username" value="${db.username}" /&gt;
      &lt;property name="password" value="${db.password}" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>and db.properties is :</p>
  
  <pre><code>db.driver=net.sourceforge.jtds.jdbc.Driver
  db.jdbcurl=jdbc:jtds:sqlserver://SQL_SERVER_HOSTNAME/TEST2012:1433/TESTDB;
  db.username=DB_UserName
  db.password=DB_Password
  </code></pre>
  
  <p>In above properties file <strong>TEST2012</strong> is an instance of SQL server and <strong>TESTDB</strong> is database on named instance.</p>
  
  <p>It's throwing below exception :</p>
  
  <pre><code>ERROR: HHH000319: Could not get database metadata
  java.sql.SQLException: No suitable driver found for jdbc:jtds:sqlserver://SQL_SERVER_HOSTNAME/TEST2012:1433/TESTDB
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:153)
      at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:144)
      at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:155)
      at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:120)
  </code></pre>
  
  <p>Any suggestions would be appreciated.   </p>