일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- 공모주 청약 일정
- IPO
- 공모주
- 제이쿼리
- linux
- php
- Stock
- 맥
- 코드이그나이터
- java
- Oracle
- MYSQL
- 주식 청약
- 자바
- 주식
- 공모주 청약
- 오라클
- codeigniter
- 자바스크립트
- 6월 공모주 청약 일정
- 주식 청약 일정
- css
- JavaScript
- 리눅스
- Eclipse
- html
- Stock ipo
- jquery
- SQL
- 7월 공모주 청약 일정
- Today
- Total
개발자의 끄적끄적
[tomcat] Tomcat JNDI Oracle/Mysql 설정[펌] 본문
[tomcat] Tomcat JNDI Oracle/Mysql 설정[펌]
1. Tomcat server.xml 에 설정정보 추가
<GlobalNamingResources>
<!-- Oracle -->
<Resource name="jdbc/JNDI_ORACLE" auth="Container"
connectionProperties="SetBigStringTryClob=true"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxActive="2"
maxIdle="2"
maxWait="-1"
type="javax.sql.DataSource"
url="jdbc:oracle:thin:@192.168.0.10:1521:ORCL"
username="TEST" password="TEST" />
<!-- MySQL -->
<Resource name="jdbc/JNDI_MYSQL" auth="Container"
driverClassName="com.mysql.jdbc.Driver"
maxActive="8" maxIdle="8" maxWait="-1"
type="javax.sql.DataSource"
url="jdbc:mysql://192.168.0.11:3306/TESTDB"
username="TEST" password="TEST" />
<GlobalNamingResources>
2. Tomcat context.xml 에 설정정보 추가
<Context>
<!-- Oracle -->
<ResourceLink name="jdbc/JNDI_ORACLE"
global="jdbc/JNDI_ORACLE"
auth="Container"
type="javax.sql.DataSource" />
<!-- MySQL -->
<ResourceLink name="jdbc/JNDI_MYSQL"
global="jdbc/JNDI_MYSQL"
auth="Container"
type="javax.sql.DataSource" />
</Context>
3. context-datasource.xml 설정 변경
파일위치 : /프로젝트명/src/main/resources/egovframework/spring/com/context-datasource.xml
[변경전]
<!--
<bean id="dataSource-oracle" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${Globals.DriverClassName}"/>
<property name="url" value="${Globals.Url}" />
<property name="username" value="${Globals.UserName}"/>
<property name="password" value="${Globals.Password}"/>
<property name="initialSize" value="0"/>
<property name="maxActive" value="2"/>
<property name="maxIdle" value="2"/>
<property name="minIdle" value="0"/>
<property name="maxWait" value="-1"/>
</bean>
<bean id="dataSource-mysql" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${Globals.DriverClassName}"/>
<property name="url" value="${Globals.Url}" />
<property name="username" value="${Globals.UserName}"/>
<property name="password" value="${Globals.Password}"/>
<property name="initialSize" value="0"/>
<property name="maxActive" value="2"/>
<property name="maxIdle" value="2"/>
<property name="minIdle" value="0"/>
<property name="maxWait" value="-1"/>
</bean>
-->
[변경후]
기존 bean 설정을 주석처리하고
<!-- Oracle -->
<bean id="dataSource-oracle" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/JNDI_ORACLE"/>
</bean>
<!-- MySQL -->
<bean id="dataSource-mysql" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/JNDI_MYSQL"/>
</bean>
끝.
출처: https://ellordnet.tistory.com/200 [IT in MT]
'개발 > was & server' 카테고리의 다른 글
AWS RDS 사용하기, PHP 연결하기, RDS charset 바꾸기 [펌] (0) | 2020.01.02 |
---|---|
[iis] Windows 10에 IIS 설치하기 (0) | 2019.12.28 |
[jeus] JNDI NamingResource 못찾는 문제 (Jeus/MySQL)[펌] (0) | 2019.12.24 |
[JEUS] WEBTOB 및 JEUS 실행 [펌] (0) | 2019.12.16 |
[ JEUS 7 ] Application deploy [펌] (0) | 2019.12.16 |