상세 컨텐츠

본문 제목

오라클 - 톰켓 연동

개발

by 동동주1123 2008. 12. 9. 13:44

본문


1. Oracle Tomcat 연결


 1) Server.xml에 resource 추가

<!-- Global JNDI resources -->

<GlobalNamingResources>

<Resource name="TEST" auth="Container" type="javax.sql.DataSource"       

driverClassName="oracle.jdbc.driver.OracleDriver"

 driverClassName=oracle.jdbc.OracleDriverà bounding 안됐던 driverClassName

factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"     

factory="oracle.jdbc.pool.OracleDataSourceFactory" à bounding 안됐던 factory        

url="jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:test"

           username="adminid"

           password="adminpwd"

           maxActive="20" maxIdle="10" maxWait="-1" />

</GlobalNamingResources>


 

 2) context.xml에 ResourceLink 추가

    <context>

        <ResourceLink global="TEST" name="TEST" type="javax.sql.DataSource"/>

    <context>



 3) web.xml에 추가(해도 되고 하지 않아도 됨)

<resource-ref>

   <description>TEST db</description>

   <res-ref-name>TEST </res-ref-name>

  <res-type>javax.sql.DataSource</res-type>

  <res-auth>Container</res-auth>

</resource-ref>


관련글 더보기