Skip to content

Instantly share code, notes, and snippets.

@aziz781
Created November 3, 2011 14:33
Show Gist options
  • Save aziz781/1336634 to your computer and use it in GitHub Desktop.
Save aziz781/1336634 to your computer and use it in GitHub Desktop.
Spring iBatis ORM Configuration data-access-config-ibatis.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<!-- @author Abdul Aziz -->
<!-- OBS : JNDI provider URL -->
<bean id="jndiObsBuss" class="org.springframework.jndi.JndiTemplate" depends-on="propertyConfigurer">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">
weblogic.jndi.WLInitialContextFactory
</prop>
<prop key="java.naming.provider.url">
${business.jndi.url}
</prop>
</props>
</property>
</bean>
<!-- Get DataSource for OBS Application server -->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean" depends-on="propertyConfigurer">
<property name="jndiTemplate">
<ref bean="jndiObsBuss"/>
</property>
<property name="jndiName" value="${datasource.jndiname}"/>
</bean>
<!-- Transaction Manager -->
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>sqlmap-config.xml</value>
</property>
<property name="dataSource" ref="dataSource" />
<property name="useTransactionAwareDataSource" value="true" />
</bean>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment