请问一下各位我用的是ibatis2.3版本,现在在SQL语句中写中文的时候读取出来以后是乱码,谢谢各位帮忙看看怎么解决。
例如:
select sid,
case
when (dayofyear(u.end_date)-dayofyear(now())) < 1 then '已过期'
end
as status
from table
这样的语句Ibatis查询出来以后是乱码。
例如:
select sid,
case
when (dayofyear(u.end_date)-dayofyear(now())) < 1 then '已过期'
end
as status
from table
这样的语句Ibatis查询出来以后是乱码。
<?xml version="1.0" encoding="UTF-8"?>
改成
<?xml version="1.0" encoding="GBK"?>
这样就没问题,原来是Ibatis编码问题,如果不改编码的话能有其它更好的办法吗?
先谢了。回复#2楼:
出现的是乱码而不是问号。
这里的编码和数据库的编码一致,应该是这样的