title: tomcat JNDI database configuration
body: <p>I have the following in C:/Tomcat6/conf/context.xml:</p>
  
  <pre><code>&lt;Context&gt;
  
      &lt;!-- Default set of monitored resources --&gt;
      &lt;WatchedResource&gt;WEB-INF/web.xml&lt;/WatchedResource&gt;
  
      &lt;ResourceLink global="jdbc/MyDatasource" name="jdbc/MyDatasource" type="javax.sql.DataSource"/&gt;
  
  
  &lt;/Context&gt;
  </code></pre>
  
  <p>and the following in C:/Tomcat6/conf/server.xml:</p>
  
  <pre><code>&lt;Resource name="jdbc/MyDatasource"
      auth="Container"
      driverClassName="net.sourceforge.jtds.jdbc.Driver"
      maxactive="100"
      maxidle="30"
      maxwait="10000"
      type="javax.sql.DataSource"    
      jdbcUrl="jdbc:jtds:sqlserver://localhost/SAFEHOUSE-UK;integratedSecurity=true;"&gt;
  </code></pre>
  
  <p></p>
  
  <p>I have jtds-1.2.5.jar in C:/Tomcat6/lib.</p>
  
  <p>Yet when I hit my application I get the following:</p>
  
  <blockquote>
    <p>org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
    driver of class 'net.sourceforge.jtds.jdbc.Driver' for connect URL
    'null'    at
    org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452)
      at
    org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
      at
    org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
      at
    com.safehouse.safeservices.authenticate.AdminLoginForm.getpassword(Unknown
    Source)</p>
  </blockquote>
  
  <p>Any help would be much appreciated</p>