1、sql-map-config.xml在src目录下:
public static SqlMapClient getSqlMapInstance() throws IOException {
Reader reader = Resources
.getResourceAsReader("sql-map-config.xml");
sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
return sqlMap;
}
2、sql-map-config.xml:
<?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>
<!-- Configure a built-in transaction manager. If you're using an
app server, you probably want to use its transaction manager