:
<? 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> <typalases> <typalias Type = "com.hc.entity.useRinfo" alias = "userInfo" /> </ typealiases> <environnements default = "Development"> <Environment Id = "MySQL"> <transactionManager type = "JDBC" /> <dataSource Type = "Poolled"> <propriété Name = "Driver" Value = "com.mysql.jdbc. Value = "JDBC: mysql: // localhost: 3306 / db_mybatis" /> <propriété name = "username" value = "hhc" /> <propriété name = "mot de passe" value = "******" /> </ dataSource> </ environnement> </mappers> </filon
:
jdbc.DriverClass = com.mysql.jdbc.driver jdbc.url = jdbc: mysql: // localhost: 3306 / db_mybatis jdbc.Username = hc jdbc.password = 123456 <? xml version = "1.0" Encoding = "utf-8"? "- // Mybatis.org//dtd config 3.0 // en" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <Properties Resource = "JDBC.Properties" /> <typealiases> <typealias type = "com.hc.entity.userine" alias = "userInfo" /> </ typaliases> <environnements default = "Development"> <environnement id = "mysql"> <transactionManager type = "jdbc"> </ transactionManager> <dataSource type = "poolled"> <propriété name = "Driver" value = "$ {jdbc.driverClass}" /> <propriété name = "URL" Value = "$ {jdbc.url}" /> <propriété name = "username" value = "$ {jdbc.Username}" /> <propriété name = "mot de passe" value = "$ {jdbc.password}" /> </ dataSource> </vironment> </enviralments> <mappers> <maper ressource = "com / hc / mapper / userInfo.xml" /> </mappers> </figuration>:
1. 在 JDBC.Properties 鼠标右键 Propriétés (属性) , 把 ISO-8859-1 更改为 UTF-8
2. 在整个项目鼠标右键 , 把 ISO-8859-1 更改为 UTF-8 具体操作如下图
总结
以上所述是小编给大家介绍的 mybatis 使用 jdbc.properties 文件设置不起作用的解决方法 , 希望对大家有所帮助 , 如果大家有任何疑问请给我留言 , 小编会及时回复大家的。在此也非常感谢大家对武林网网站的支持!