WEB-INF/resin-web.xml

<web-app xmlns="http://caucho.com/ns/resin">
  <!--
     - Configures the database.
     -
     - jndi-name specifies the JNDI name
     - type      specifies the driver class
     - path      is a driver-specific configuration parameter
    -->
  <database jndi-name="jdbc/basic">
    <driver type="com.caucho.db.jca.ConnectionFactory">
      <url>resin:WEB-INF/db</url>

      <remove-on-error/>
    </driver>
  </database>

  <!--
     - Configures the initialization servlet.  The bean-style init
     - it used to look up the JNDI DataSource in the configuration file.
    -->
  <servlet servlet-name="init" servlet-class="example.InitServlet">
    <init>
      <data-source>${jndi:lookup('jdbc/basic')}</data-source>
    </init>
    <load-on-startup/>
  </servlet>

  <servlet servlet-name="basic" servlet-class="example.BasicServlet">
    <init>
      <data-source>${jndi:lookup('jdbc/basic')}</data-source>
    </init>
  </servlet>

  <servlet-mapping url-pattern="/basic" servlet-name="basic"/>
</web-app>