Setting up a JNDI Data Source in Spring
Just put something like this in your applicationContext.xml
<bean id=”appDS” class=”org.springframework.jndi.JndiObjectFactoryBean”>You’re properties and jndiName will probably be different. But still — no code, just configuration. It doesn’t get much better than that!
<property name=”jndiEnvironment”>
<props>
<prop key=”java.naming.factory.initial”>weblogic.jndi.WLInitialContextFactory</prop>
<prop key=”java.naming.provider.url”>t3://localhost</prop>
</props>
</property>
<property name=”jndiName” value=”datasourcejndi_name”>
</property>
</bean>
Powered by ScribeFire.