最近写了一个查询语句,比如select a as姓名 from table1 一直报错,但是把代码复制到PL/sql又可以查询到结果,查询了网上的很多方法,最后解决了,这种情况还可能因为你的数据库中的数据为汉字,或者字节问题也可能查询不到记录,比如 select a.name,a.tell from table a where name='"+name+"' 其中name为汉字,也可能查询不能结果,其实解决的方法很简单,只要在连接语句中加入
Unicode=true就可以了,比如<add key="cn" value="Password=webuser;User ID=webuser;Data Source=DBName;Persist Security Info=false;Unicode=true"/>
oracle 中SQL语句不能包括汉字的解决方法
最新推荐文章于 2024-04-15 10:46:34 发布