hibernate之HQL传中文参数乱码 解决办法
2007-11-27 17:59
260 查看
在spring+hibernate中:Hql中有中文参数(如from test as c where c.name='张三')的话被翻译成sql的时候会出现乱码,解决办法是在application.xml中加入以下语句:
<prop key="hibernate.query.factory_class">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</prop>
在struts+hibernate中
hibernate的配制文件hibernate.cfg.xml中加入
<property name="query.factory_class">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</property>
<prop key="hibernate.query.factory_class">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</prop>
在struts+hibernate中
hibernate的配制文件hibernate.cfg.xml中加入
<property name="query.factory_class">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</property>
相关文章推荐
- hibernate之HQL传中文参数乱码 解决办法
- asp.net中URL参数传值中文乱码的三种解决办法
- asp.net页面通过URL参数传值中文乱码问题解决办法
- 关于JAVA中URL传递中文参数,取值是乱码的解决办法
- JQuery中Ajax的Post提交中文乱码、windows.location.href 中文汉字乱码和springmvc使用原生态HttpServletRequest接收参数中文乱码解决办法
- jsp传中文参数Java后台获取乱码解决办法
- URL传递中文参数乱码解决办法
- asp.net中URL参数传值中文乱码的三种解决办法
- 关于JAVA中URL传递中文参数,取值是乱码的解决办法
- javascript 转URL传中文参数乱码问题解决办法
- GET方法传递中文参数乱码解决办法
- 日常问题记录--JSP页面中通过<s:property value="#parameters.userName[0]>获取URL参数中文时为乱码的解决办法
- Hibernate HQL concat 中文乱码问题解决
- 关于JAVA中URL传递中文参数,取值是乱码的解决办法
- spring mvc url 参数传递出现中文乱码解决办法
- struts2中form提交到action中的中文参数乱码问题解决办法(包括取中文路径)
- tomcat取带有中文的参数乱码的解决办法
- js代替表单提交带中文的参数出现乱码的解决办法
- jsp中request接收中文参数乱码问题解决办法
- JS传中文参数乱码时解决办法