Spring-Mybatis中导入Mybatis原生配置文件

sqlSessionFactory Bean中设置设置configLocation属性

<property name="configLocation" value="classpath:mybatis.xml"></property>

mybatis.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>  

   <settings>  

     <setting name="mapUnderscoreToCamelCase" value="true"/>  

   </settings>  

</configuration> 

Mybatisproperties文件的引入

使用properties标签,如下,resource是类路径,url是网络路径或磁盘路径资源

<configuration>

<properties resource=”dbconfig.properties” ></properties>

。。。。

相关文章:

  • 2022-12-23
  • 2021-09-20
  • 2021-09-23
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
猜你喜欢
  • 2021-11-09
  • 2021-12-07
  • 2022-12-23
  • 2021-05-28
  • 2021-12-19
  • 2021-06-08
相关资源
相似解决方案