2013. 3. 7. 09:19

톰캣6 Datasource 사용하기

톰캣 설치폴더

 

server.xml

 

GlobalNamingResources 안에 resourcename 추가

 

  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="jdbc/OracleDS" auth="Container" type="javax.sql.DataSource"
          username="id"
          password="passwd"
          driverClassName="oracle.jdbc.driver.OracleDriver"
          url="jdbc:oracle:thin:@localhost:1521:sid" /> 
   
  </GlobalNamingResources>

 

122 라인 부근 주석처리

<!--

<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>

-->

context.xml

<Context reloadable="true" privileged="true">

    <WatchedResource>WEB-INF/web.xml</WatchedResource>

    <ResourceLink name="jdbc/OracleDS" global="jdbc/OracleDS" type="javax.sql.DataSource"/>
</Context>

 

 

 

Context.lookup 호출주소

 

java:comp/env/jdbc/OracleDS

'-=-= 컴퓨터 =-=- > WebServer & WAS' 카테고리의 다른 글

JBOSS DATASOURCE 설정  (0) 2013.05.08
JBoss URIEncoding 설정  (0) 2013.03.28
apache 재시작 오류  (0) 2013.03.17
톰캣 "web-app" must match 오류  (0) 2013.03.12
톰캣 쿠키 = 인식 옵션  (0) 2013.03.11