Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server Hibernate查询与国际字符_Sql Server_Hibernate_Encoding_Internationalization - Fatal编程技术网

Sql server Hibernate查询与国际字符

Sql server Hibernate查询与国际字符,sql-server,hibernate,encoding,internationalization,Sql Server,Hibernate,Encoding,Internationalization,我在JavaSE应用程序中使用hibernate从数据库中查询一些数据。但我需要在where子句中使用波兰语字符,例如: where province='MAŁOPOLSKA' 但结果集为空。 使用SQL Server时,我只需要在'Małopolska'字符串前添加N个字母。 我试图找到一个解决方案,我唯一找到的就是把这些行放到配置文件中 <property name="hibernate.connection.CharSet">UTF-8</property> &

我在JavaSE应用程序中使用hibernate从数据库中查询一些数据。但我需要在where子句中使用波兰语字符,例如:

where province='MAŁOPOLSKA' 
但结果集为空。

使用SQL Server时,我只需要在'Małopolska'字符串前添加N个字母。 我试图找到一个解决方案,我唯一找到的就是把这些行放到配置文件中

<property name="hibernate.connection.CharSet">UTF-8</property>
<property name="hibernate.connection.characterEncoding">UTF-8</property>
<property name="hibernate.connection.useUnicode">true</property>
UTF-8
UTF-8
符合事实的
但它不会改变任何东西,即我得到的结果集是空的

如有任何提示,将不胜感激。

已解决。 我用参数替换了普通的'MAŁOPOLSKA'字符串,效果很好。例如:

where province = :provName
q.setParameter("provName", 'MAŁOPOLSKA');