Setting up a JNDI Data Source in Spring
Aug 17th, 2007No Comments
Just put something like this in your applicationContext.xml
<bean id=”appDS” class=”org.springframework.jndi.JndiObjectFactoryBean”>
<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=”data_source_jndi_name”>
</property>
</bean>
You’re properties and jndiName will probably be different. But still — no code, just configuration. It doesn’t get much better than that!
Powered by ScribeFire.
