复制代码 代码如下:
public void exporthiberntetosql(){
configuration cfg=new configuration().configure("/hibernate.cfg.xml");
schemaexport schemaexport = new schemaexport(cfg);
schemaexport.setoutputfile("d:/mysql_sql.sql");
schemaexport.create(true, false);
}
注意:hibernate的配置文件是什么数据库方言和驱动,将生成什么数据库脚本。
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!