下面是ORACLE 的配置:
J2EE_HOME\config\resource.properties
加入: 
 jdbcDataSource.4.name=jdbc/dbjndiname
jdbcDataSource.4.url=jdbc:oracle:thin:@hostip:1521:ora8i
在项目文件的resources中:文件:sun-j2ee-ri.xml设置(要加入sqlserver的驱动)
<web>
    <module-name>ecomm.war</module-name>
    <context-root>ecomm</context-root>
    <resource-ref>
      <res-ref-name>jdbc/dbjndiname</res-ref-name>
      <jndi-name>jdbc/dbjndiname</jndi-name>
      <default-resource-principal>
        <name>username</name>
        <password>password</password>
      </default-resource-principal>
    </resource-ref>
  </web>