i need to connect to multiple databases configured in my config.xml file
config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.ibm.as400.access.AS400JDBCDriver"/>
<property name="url" value="url"/>
<property name="username" value="usernmae"/>
<property name="password" value="password"/>
</dataSource>
</environment>
<environment id="test">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.ibm.as400.access.AS400JDBCDriver"/>
<property name="url" value="url"/>
<property name="username" value="usernmae"/>
<property name="password" value="password"/>
</dataSource>
</environment>
</environments>
</configuration>
i am using mapper interface and mapper.xml for queries
Mapper Interface
@Mapper
public interface OrderMapper {
List<Order> selectAll();
}
Mapper.xml
<mapper namespace="com.mapper.OrderMapper" >
<resultMap id="result" type="com.mapper.Order">
<result property="orderId" jdbcType="NUMERIC" column="ORD_ORDER_ID"/>
</resultMap>
<select id="selectAll" resultMap="result">
SELECT * FROM table
</select>
</mapper>
Application.properties
mybatis.config-location = classpath:./config.xml
mybatis.mapper-locations=./mapper/*.xml
i am able to work for single database by using spring datasource in properties file..nut i am unable to make it work through the config file..what am i doing wrong ?