title: Tomcat 7: How do I specify Database resource when making connection to Microsoft Access
body: <p>I know how to specific datasource connection pooling to a mysql server in Tomcat 7, add </p>
  
  <pre><code>&lt;Resource type="javax.sql.DataSource"
          name="jdbc/TestDB"
          factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
          driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/mysql"
          username="mysql_user"
          password="mypassword123"
  /&gt;
  </code></pre>
  
  <p>to my <code>META-INF/context.xml</code>, </p>
  
  <ol>
  <li>Can anyone show me how to do this to <code>Microsoft Access</code>?</li>
  <li>Do I need a JDBC - ODBC bridge to make connection from my Java web app to Microsoft Access?</li>
  </ol>
  
  <p><strong>UPDATE</strong>: This is my attempt, but I ran into <code>SQLException</code></p>
  
  <pre><code>&lt;Resource  type="javax.sql.DataSource"
             name="jdbc-odbc/qtl"
             maxActive="100"
             maxIdle="30"
             maxWait="10000"
             factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
             driverClassName="sun.jdbc.odbc.JdbcOdbcDriver"
             url="jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=/Users/KingdomHeart/resources/db.mdb"               
             /&gt;
  </code></pre>
  
  <p>When I do this, I got <code>WARNING: Unexpected exception resolving reference
  java.sql.SQLException: sun.jdbc.odbc.JdbcOdbcDriver</code></p>
  
  <p><strong>UPDATE 2:</strong>: I tried to write a separate program in effort to make connection to Microsoft Access db. I got <code>java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver</code> Here is my code. It must be that I need a <code>jar</code> driver in my class path, do I not?</p>
  
  <pre><code>public static void main(String[] args) {
      try {
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          String fileName = "/Users/KingdomHeart/resources/MyTable.mdb";
          String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
          database += fileName + ";DriverID=22;READONLY=true";
          Connection con = DriverManager.getConnection(database, "", "");
          System.out.println("here");
      } catch (SQLException ex) {
          Logger.getLogger(TestJdbcOdbc.class.getName()).log(Level.SEVERE, null, ex);
      } catch (ClassNotFoundException ex) {
          Logger.getLogger(TestJdbcOdbc.class.getName()).log(Level.SEVERE, null, ex);
      }
  }
  </code></pre>