亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

數據添加不進表中,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&amp;characterEncoding=UTF-8</property>

測試的時候報錯了,java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer

為什么呢?我是按照視頻一步一步做的。誰能解答一下。



正在回答

舉報

0/150
提交
取消

數據添加不進表中,junit報異常java.lang.ClassCastException

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號