数据转换bug花了半天时间 Java.math.BigDecimal cannot be cast to java.lang.String

数据库取出一个 Count函数 统计的值

在代码中要转成Integer类型的时候

Integer.parseInt((String)map.get("ID_")) 

报了一下错误: Java.math.BigDecimal cannot be cast to java.lang.String

解决方法:

Object ob = map.get("ID_");先将数据转成

Integer.parseInt(ob.toString());

http://blog.csdn.net/frist_huangsuli/article/details/7866452

      扫码关注公众号

 
 
 
原文地址:https://www.cnblogs.com/freedommovie/p/6407334.html