部署IBatis例子JPetstore源码-IBatis中配置JNDI(第二步)

IBatis配置上Tomcat的JNDI

 

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
    "
http://ibatis.apache.org/dtd/sql-map-config-2.dtd">

<sqlMapConfig>

 

  <transactionManager type="JDBC">
    <dataSource type="JNDI">
   <property name="DataSource" value="java:comp/env/jdbc/jpetstore" />
     </dataSource>
  </transactionManager>

 

  <sqlMap resource="com/ibatis/jpetstore/persistence/sqlmapdao/sql/Account.xml"/>
  <sqlMap resource="com/ibatis/jpetstore/persistence/sqlmapdao/sql/Category.xml"/>
  <sqlMap resource="com/ibatis/jpetstore/persistence/sqlmapdao/sql/Product.xml"/>
  <sqlMap resource="com/ibatis/jpetstore/persistence/sqlmapdao/sql/Sequence.xml"/>
  <sqlMap resource="com/ibatis/jpetstore/persistence/sqlmapdao/sql/LineItem.xml"/>
  <sqlMap resource="com/ibatis/jpetstore/persistence/sqlmapdao/sql/Order.xml"/>
  <sqlMap resource="com/ibatis/jpetstore/persistence/sqlmapdao/sql/Item.xml"/>

 

</sqlMapConfig>

 

你可能感兴趣的:(sql,tomcat,xml,ibatis,jdbc)