Server에 oracle 등록을 해야 DB연동이 가능하다. 그래서 Server에 등록하는 작업을 해야한다.
Context.xml에 추가해야할 사항
context태그안에 위치에 맞게 빨간색 줄을 집어 넣어야 한다.
<!-- Uncomment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) -->
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
-->
<ResourceLink global="jdbc/myoracle" name="jdbc/myoracle" type="javax.sql.DataSource"/>
</Context>
Server.xml 에 추가해야 할 소스
GlobalNamingResources태크안에 빨간색 소스를 위치에 맞게 넣어줘야 한다.
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
<Resource auth="Container" driverClassName="oracle.jdbc.OracleDriver" maxActive="20" maxIdle="10" maxWait="-1" name="jdbc/myoracle" password="tiger" type="javax.sql.DataSource" url="jdbc:oracle:thin:@localhost:1521:xe" username="scott"/>
</GlobalNamingResources>