1. ojdbc14.jar拷贝到Tomcat的lib下
2. 配置Tomcat 的conf/context.xml
<Context>
<Resource name="jdbc/shop"
auth="Container" type="javax.sql.DataSource" maxActive="100"
maxIdle="30" maxWait="10000" username="ceshi" password="pwd1234"
driverClassName="oracle.jdbc.OracleDriver "
url="jdbc:oracle:thin:@localhost:1521:orcl "/>
</Context>
3. 使用JNDI获取连接对象
Context ic = new Initi