* spring connection pool 사용시
[datasource-context.xml]
<!-- Properties Files -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:properties/jdbc.properties</value>
</list>
</property>
<bean>
<!-- DataSource Configuration -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<property name="initialSize" value="5"/>
<property name="maxActive" value="20"/>
<property name="minIdle" value="5"/>
<property name="maxWait" value="3000"/>
<property name="poolPreparedStatements" value="true"></property>
<property name="maxOpenPreparedStatements" value="50"></property>
</bean>
-------------------------------------------------------------------------------------------------------
* jeus connection pool 사용시
[datasource-context.xml]
위 내용을 아래로 변경
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>DataSource</value>
</property>
</bean>
[WEB-INF/jeus-web-dd.xml]
아래 내용 추가
<res-ref>
<jndi-info>
<ref-name>jdbc/DataSource</ref-name>
<export-name>jdbc/DataSource</export-name>
</jndi-info>
</res-ref>
[WEB-INF/web.xml]
아래 내용 추가
<resource-ref>
<res-ref-name>jdbc/DataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
'Carpe Programming > jsp & spring & jstl' 카테고리의 다른 글
[jQuery] 외부 로드로 웹 트레픽 줄이기 (0) | 2013.07.12 |
---|---|
[spring] 스케쥴러 설정 (0) | 2013.02.18 |
[jsp] commons-fileupload 를 이용한 간단한 파일 업로드 (0) | 2012.07.11 |
[Spring] ExceptionResolver 구성하기 (0) | 2012.04.16 |
[maven] 자동으로 build 안될 경우 (0) | 2012.03.08 |