hibernate 导出数据库成功 在hibernate里面做数据库

来源:互联网 发布:电力行业大数据应用 编辑:程序博客网 时间:2024/05/30 23:40

还是在工具包下面    com.xie.util    建一个类    ExportDB


package com.xie.util;



import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;




public class ExportDB {


/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub


Configuration cfg=new Configuration().configure();
SchemaExport export=new SchemaExport(cfg);
export.create(true, true);
System.out.print("导出数据库成功");
}


}
0 0
原创粉丝点击