今天本想取出数据库里德尔某个字段 数据类型为char(36) 项目采用SSH框架
SELECT Ques_Sub_ID FROM ques_sub_personal WHERE Ques_ID ='123' 返回值类型时List<Object[]> ;
结果在运行时控制台打印 错误 java.lang.Character cannot be cast to [Ljava.lang.Object
有时mysql数据表中字段类型为char会出现上述错误,解决办法是采用mysql函数cast
SELECT CAST(Ques_Sub_ID AS CHAR(36)) FROM ques_sub_personal WHERE Ques_ID ='123'