Friday, September 5, 2014

Tomcat profile with JNDI datasource in RAD

Setup TOMCAT Profile with JNDI datasource inRAD

applicationContext-resources.xml


Step 1 :

<!-- This is a bean profile which can override items in the WebSphere profile for Tomcat like application servers. -->
    <!-- To activate this profile add -Dspring.profiles.active="tomcat" to your server startup, do not change the default profile setting in the web.xml -->
    <beans profile="tomcat">
        <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager" p:sessionFactory-ref="sessionFactory" />

            <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
              <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
              <property name="url" value="jdbc:oracle:thin:@rac.development.aamc.org:1521/AMCAS" />
              <property name="username" value="CFRANCISCO[mcat_thx]" />
              <property name="password" value="Aamc#2012" />
              <property name="maxActive" value="10" />
              <property name="maxIdle" value="1" />
              <property name="maxWait" value="1000" />
              <property name="defaultAutoCommit" value="true" />
              <property name="poolPreparedStatements" value="true" />
              <property name="maxOpenPreparedStatements" value="100" />
              <property name="validationQuery" value="SELECT 1 from DUAL"/>
            </bean>
    </beans>

Step 2:

To activate this profile add -Dspring.profiles.active="tomcat" to your server startup or JVM arguement.







No comments:

Post a Comment