import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class SchemaUtil {
public static void main(String[] args) {
<span style="white-space:pre"> </span>Configuration cfg = new Configuration().configure();
SchemaExport schemaExport= new SchemaExport(cfg);
schemaExport.create(false, true); //schemaExport.create(false, true);第1个boolean类型是说是否覆盖原有的数据库,第2个boolean是说,是否新建数据库
}
}