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

2016-02-19 09:46 11 1 收藏

清醒时做事,糊涂时读书,大怒时睡觉,无聊时关注图老师为大家准备的精彩内容。下面为大家推荐根据Hibernte的cfg文件生成sql文件,无聊中的都看过来。

【 tulaoshi.com - Web开发 】

代码如下:

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://www.tulaoshi.com/n/20160219/1592082.html

延伸阅读
标签: ASP
使用ASP生成HTML文件 共有两个页面index.htm是首页.程序比较简单,主要是用了ASP里的文件操作对象。   <!--index.htm---------------------- <html <head <titleUntitled Document</title <meta http-equiv="Content-Type" content="text/html; charset=gb2312" </head <body <table width="770" bord...
代码如下: package com.qhdstar.java.pdf; import java.awt.Color; import java.io.FileOutputStream; import com.lowagie.text.Chapter; import com.lowagie.text.Document; import com.lowagie.text.Font; import com.lowagie.text.FontFactory; import com.lowagie.text.PageSize; import com.lowagie.text.Paragraph; import com.lowag...
1. 在*.mft或*.mf文件中输入如下的内容: main-class: Hello 注意: (1) 冒号后有一空格; (2) Hello是启动运行类Hello.class的文件名; (3) Hello 后有一个回车符, 一定不能少; (4) *.mf 是标明文件;(包含来自标明文件的标明信息) 2. Jar 命令的使用 例如: (1) jar cvfm abc.jar run.mf *...
     本文介绍了在 Linux 系统中,通过 Gnu autoconf 和 automake 生成 Makefile 的方法。主要探讨了生成 Makefile 的来龙去脉及其机理,接着具体介绍了配置 Configure.in 的方法及其规则。 引子     无论是在Linux还是在Unix环境中,make都是一个非常重要的编译命令。不管是自己进行项目开发还是安装应用软...
标签: PHP
  用php生成excel文件   <? header("Content-type:application/vnd.ms-excel"); header("Content-Disposition:filename=test.xls"); echo "test1\t"; echo "test2\t\n"; echo "test1\t"; echo "test2\t\n"; echo "test1\t"; echo "test2\t\n&q...

经验教程

809

收藏

12
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部