MYSQL数据库:
from RestaRestaurantTable as rt where rt.rentNameCode like '%厅%'
这条语句,在执行后,没有任何查询结果,但数据库里有相关信息,from RestaRestaurantTable as rt where rt.rentNameCode like '%1%'
这条语句,在执行后,就有查询结果为什么输入汉字查询就不行呢
from RestaRestaurantTable as rt where rt.rentNameCode like '%厅%'
这条语句,在执行后,没有任何查询结果,但数据库里有相关信息,from RestaRestaurantTable as rt where rt.rentNameCode like '%1%'
这条语句,在执行后,就有查询结果为什么输入汉字查询就不行呢
JDBC的话在连接字符串后面加上一个参数,具体你网上搜一下我手头没有Hibernate的话加以下标签
<property name="connection.useUnicode">true</property>
<property name="connection.characterEncoding">GBK</property>