当前位置:主页 > 软件编程 > JSP代码 >

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

时间:2021-06-20 08:48:08 | 栏目:JSP代码 | 点击:

复制代码 代码如下:

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

您可能感兴趣的文章:

相关文章