网络编程 
首页 > 网络编程 > 浏览文章

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

(编辑:jimmy 日期: 2024/10/7 浏览:3 次 )
复制代码 代码如下:
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的配置文件是什么数据库方言和驱动,将生成什么数据库脚本。
上一篇:五种 JSP页面跳转方法详解
下一篇:jsp 页面显示的一些用法