1 @Test 2 public void testCreateDB(){ 3 Configuration cfg = new Configuration().configure(); 4 SchemaExport se = new SchemaExport(cfg); 5 //第一个参数 是否生成ddl脚本 第二个参数 是否执行到数据库中 6 se.create(true, true); 7 }