当前位置:主页 > 查看内容

根据Hibernte的cfg文件生成sql文件

发布时间:2021-07-14 00:00| 位朋友查看

简介:复制代码 代码如下: public void exportHibernteToSQL(){ Configuration cfg=new Configuration().configure("/hibernate.cfg.xml"); SchemaExport schemaExport = new SchemaExport(cfg); schemaExport.setOutputFile("d:/mysql_sql.sql"); schemaExport.cr……
复制代码 代码如下:

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的配置文件是什么数据库方言和驱动,将生成什么数据库脚本。

本文转载自网络,原文链接:https://m.jb51.net/article/17599.htm
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!
上一篇:五种 JSP页面跳转方法详解 下一篇:没有了

推荐图文


随机推荐