eclipse4.6.3+hibernate 5.1.4+mysql5.7.18+jdbc5.1.42
老师的方法亲测可行!
只需将
jdbc:mysql:///hibernate?useUnicode=true&characterEncoding=UTF-8
改成jdbc:mysql://127.0.0.1:3306/hibernateuseUnicode=true&characterEncoding=UTF-8
其中hibernate是数据库名称,你得提前在mysql里面创建好,也可以换成mysql里面其它你已建好的数据库
老师的方法亲测可行!
只需将
jdbc:mysql:///hibernate?useUnicode=true&characterEncoding=UTF-8
改成jdbc:mysql://127.0.0.1:3306/hibernateuseUnicode=true&characterEncoding=UTF-8
其中hibernate是数据库名称,你得提前在mysql里面创建好,也可以换成mysql里面其它你已建好的数据库
2017-06-08
public class StudentTest {
@Before...
@After...
@Test
public void testSaveStudents(){
//生成学生对象
Students s=new Students(1,"zhangsan","男",new Date(),"wuzhou");
session.save(s);
}
}
在创建s时出现,The constructor Students(int, String, String, Date, String) is undefined报错,是因为什么?
@Before...
@After...
@Test
public void testSaveStudents(){
//生成学生对象
Students s=new Students(1,"zhangsan","男",new Date(),"wuzhou");
session.save(s);
}
}
在创建s时出现,The constructor Students(int, String, String, Date, String) is undefined报错,是因为什么?
2017-05-31
出现Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4错误,把Students.hbm.xml中picture的属性从com.mysql.Blob改成java.sql.Blob就对了
2017-05-31