db.properties中配置了url等jdbc连接属性:
driver=org.sqlite.JDBC
url=jdbc:sqlite:D:/xxx/data/sqliteDB/demo.db
username=
password=
spring的applicationContext.xml中配置数据源引用这些属性,但遗憾的是,运行报错了:
Caused by: java.sql.SQLException: unkow jdbc driver : ${url}
解决方案:
把MapperScannerConfigurer节那个bean的sqlSessionFactory属性
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
改成:<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />