我想在许多模块上使用相同的 ibatis sqlMapConfig。
不幸的是,在我的 sqlMap 的资源属性中似乎只允许类路径资源:
<?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>
<sqlMap resource="myresource.xml" />
</sqlMapConfig>
这不起作用:
<sqlMap resource="file:/myresource.xml" />
有什么方法可以避免口是心非(在多个类路径上使用一个 ibatis-config)?
最佳答案
使用 url
属性:
<sqlMap url="file:///myresource.xml" />
关于java - 如何在 ibatis sqlMap 配置中使用文件资源而不是类路径资源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3900133/