nested exception is java.sql.SQLException: Unknown type '246 in column 1 of 3 in binary-encoded result set. 问题

进行数据库(mysql5.0)查询时出现如下异常:

nested exception is java.sql.SQLException: Unknown type '246 in column 1 of 3 in binary-encoded result set.

之所以这里又重申了一下,是因为网上说 :"当Mysql 5.0表数据类型设计为DECIMAL时,在spring,hibernate项目运行会出现246错误: "     貌似我没有这个问题.我的查询语句如下:
    String sql = "select a.contentId,sum(if(rs.id is null,0,1)),ifnull(rs.sm,0) " +
                      "from (select w.contentId id,sum(if(w.contentId is null,0,1))sm " +
                      "from wapcontent w,wapuserdownlog l " +
                      "where w.contentId=l.ContentID " +
                      "group by w.contentId) rs " +
                      "right join useraccesslog a on rs.id=a.contentId " +
                      "group by a.contentId order by  sum(if(rs.id is null,0,1)) desc";

 

出现此结果,网上还有一种说法说是 mysql的jar包过低,低于3.0.17就会有此问题,但是我的是3.1.7的(appfuse+webwork1.8.2 默认包版本),不过最终问题的确是包的问题,当我将项目的包替换为mysql-connector-java-5.0.3bin.jar 之后,该问题不再出现

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值