Spring JNDI Datasource and Development Datasource


<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiName" value="com/dev/sss" />
		<property name="defaultObject" ref="developmentDataSource" />
	</bean>

	<!-- fall back datasource if JNDI look up of main datasource fails -->
	<bean id="developmentDataSource" 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>10</value>
		</property>
		<property name="maxActive">
			<value>0</value>
		</property>
		<property name="maxWait">
			<value>5000</value>
		</property>

	</bean>
Advertisements