首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

tomcat6.0配备jndi

2012-09-20 
tomcat6.0配置jndi1.在..\apache-tomcat-6.0.0\apache-tomcat-6.0.0\conf\context.xml中加入Resource nam

tomcat6.0配置jndi
1.在..\apache-tomcat-6.0.0\apache-tomcat-6.0.0\conf\context.xml中
加入
<Resource name="jdbc/Project" auth="Container"
                 type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
                 url="jdbc:oracle:thin:@IP:1521:oracle"
                 username="test" password="test" maxActive="20" maxIdle="10"
                 maxWait="-1"/>
2.在\apache-tomcat-6.0.0\apache-tomcat-6.0.0\lib加入oracle-jdbc-1.4-9.2.0.6.jar
相应的数据库驱动包
3.配置web.xml
   <!-- -->
<resource-ref>
<description></description>
<res-ref-name>jdbc/Project</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
4.配置applicationContext.xml
<!---->
<bean id="dataSource"
value="java:comp/env/jdbc/Project"/>
</bean>

ok!

热点排行