今天在编写hql语句时出现如下错误,就是在mysql5.02.jar驱动下Sum函数不可用,
后来发现是数据库驱动的问题,只要将mysql5驱动换一下就好了
java.sql.SQLException: Unknown type '246 in column 2 of 3 in binary-encoded result set.
com.mysql.jdbc.MysqlIO.extractNativeEncodedColumn(MysqlIO.java:3710)
com.mysql.jdbc.MysqlIO.unpackBinaryResultSetRow(MysqlIO.java:3620)
com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1282)
com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2198)
com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:413)
com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:1899)
com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1347)
--转自