Announcement Announcement Module
Collapse
No announcement yet.
Adding properties to Jboss JNDI DataSource Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding properties to Jboss JNDI DataSource

    Hi,

    I'm using Jboss AS 6 with Spring 2.5.6

    In my applicationContext.xml, I have:
    Code:
    <jee:jndi-lookup id="dataSource" jndi-name="java:/MyDataSource"/>
    This is the xml of my datasource:
    Code:
     <local-tx-datasource>
            <jndi-name>MyDataSource</jndi-name>
            <connection-url>jdbc:oracle:thin:@<ip>:<port>:<sid></connection-url>
            <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
            <user-name>username</user-name>
            <password>password</password>
            <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
            <metadata>
                <type-mapping>oracle</type-mapping>
            </metadata>
    
            <idle-timeout-minutes>5</idle-timeout-minutes>
            <min-pool-size>5</min-pool-size>
            <max-pool-size>20</max-pool-size>
            <query-timeout>300</query-timeout>
            <use-fast-fail>true</use-fast-fail>
        </local-tx-datasource>
    Now, how do I add other properties (like read tiemout) in my datasource?

    When I was not using JNDI DataSource, we have something like this:
    Code:
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    		<property name="driverClassName">
    			<value>{driverClassName}</value>
    		</property>
    		<property name="url">
    			<value>${url}</value>
    		</property>
    		<property name="username">
    			<value>${username}</value>
    		</property>
    		<property name="password">
    			<value>${password}</value>
    		</property>
    		<property name="initialSize">
    			<value>${initialSize}</value>
    		</property>
    		<property name="maxActive">
    			<value>${maxActive}</value>
    		</property>
    		<property name="maxIdle">
    			<value>${maxIdle}</value>
    		</property>
    		<property name="minIdle">
    			<value>${minIdle}</value>
    		</property>
    		<property name="maxWait">
    			<value>${maxWait}</value>
    		</property>
    		<property name="timeBetweenEvictionRunsMillis">
    			<value>${timeBetweenEvictionRunsMillis}</value>
    		</property>
    		<property name="numTestsPerEvictionRun">
    			<value>${numTestsPerEvictionRun}</value>
    		</property>
    		<property name="minEvictableIdleTimeMillis">
    			<value>${minEvictableIdleTimeMillis}</value>
    		</property>
    		<property name="maxOpenPreparedStatements">
    			<value>${maxOpenPreparedStatements}</value>
    		</property>
    		<property name="poolPreparedStatements">
    			<value>${poolPreparedStatements}</value>
    		</property>
    	</bean>
    How do I copy the properties from the previous datasource to the one that was using JNDI?

    Thanks!
Working...
X