Map 循环问题。。。
代码:
Map<String, Student> obj=studentDaoImpl.getMapStudent();
System.out.println(obj);
for(Map.Entry<String, Student> entry : obj.entrySet()){
System.out.println("key: "+entry.getKey() +"; value: "+ entry.getValue() );
}
错误信息:
{0={id=0, birth=2011-09-02 00:00:00.0, name=李四, score=88}, 2={id=2, birth=2011-09-02 00:00:00.0, name=李四, score=88}}
Exception in thread "main" java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.String
at com.iflytek.test.TestIbatis.main(TestIbatis.java:57)
数据列:
id NUMBER not null,
name VARCHAR2(30),
birth DATE,
score NUMBER