使用hibernate的时候不能自动建表,有几种方法排除
1.确定hibernate的包的导入
2.在hibernate.cfg.xml文件中<property name="hbm2ddl.auto"> 的值为create。这个属性值有几种,当为create 时,为自动建表
3. 在hibernate.cfg.xml文件<property name="dialect"> org.hibernate.dialect.MySQLDialect 的问题,即使是Mysql 数据库,根据引擎的不同有三种方言
org.hibernate.dialect.MySQLDialect
org.hibernate.dialect.MySQLInnoDBDialect
org.hibernate.dialect.MySQLMyISAMDialect
看自己是开了什么引擎,不知道就一个个试一下吧