You can use following jndi configuration.
<beans:bean id="weblogicDataSource" class="org.springframework.remoting.rmi.JndiRmiProxyFactoryBean"> <beans:property name="jndiName" value="ConnectionPoolJNDINameAsConfigured"></beans:property> <beans:property name="jndiEnvironment"> <beans:props> <beans:prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</beans:prop> <beans:prop key="java.naming.provider.url">iiop://localhost:7001</beans:prop> </beans:props> </beans:property> <beans:property name="serviceInterface" value="javax.sql.DataSource"></beans:property> </beans:bean>
and you make the reference to your injected class file as
<beans:bean id="xxxx" class="xxxxxxxx"> <beans:property name="wlDataSource" ref="weblogicDataSource" /> </beans:bean>
and in your implemenation class, use
import javax.sql.DataSource;
make an instance as private DataSource wlDataSource;
and corresponding setter. Now you are free to use JDBCTemplate or SimpleJDBCCall etc as per your implementation thinking.