我的程序出现了一下两个Exception:
org.hibernate.exception.DataException: could not insert: [model.Student]
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]
[SQLServer]将截断字符串或二进制数据。
到网上看了一下,大多说字段不够长,但是我已经将字段定得够长了,还是出现这样的问题.
以下是操作类:
public class BM 
{
public static void main(String[] args)
{
Student stu=new Student();
stu.setstuName("wu");
stu.setCardId("102");
stu.setAge(33);
DAOImp.createStu(stu);
}
}
数据库中的字段:
stuName      nvarchar     50
cardId       nvarchar     50
age          int          4
我想问下为什么还是出现这样的错误?