数据添加不进表中,junit报异常java.lang.ClassCastException
Students s1 = new Students("S0000001","张三丰","男",new Date(),"武当山");
Students s2 = new Students("S0000002","郭靖","男",new Date(),"桃花岛");
Students s3 = new Students("S0000003","黄蓉","女",new Date(),"桃花岛");
session.save(s1);
session.save(s2);
session.save(s3);
之前学生定义为public Students(String id, String name, String gender, Date birthday, String address)
mysql是utf8
jdbc也是<property name="connection.url">jdbc:mysql:///test?useUnicode=true&characterEncoding=UTF-8</property>
测试的时候报错了,java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
为什么呢?我是按照视频一步一步做的。谁能解答一下。