SchemaExport se=new SchemaExport(cfg).setOutputFile("xby.sql"); se.execute(true,true,false,false); 第一个true指导出sql文件,第二个true指执行数据库DDL. pu