Hibernate_ExportDB

   1. package com.ufinity.hibernate.util;  
   2.   
   3. import org.hibernate.cfg.Configuration;  
   4. import org.hibernate.tool.hbm2ddl.SchemaExport;  
   5.   
   6. /** 
   7.  *  
   8.  * @author skyqiang 
   9.  * 
  10.  */  
  11. public class ExportDB {  
  12.     public static void main(String[] args) {  
  13.           
  14.         //read configuration file  
  15.         Configuration config = new Configuration();  
  16.           
  17.         //create SchemaExport object  
  18.         SchemaExport export = new SchemaExport(config);  
  19.           
  20.         //create table of database  
  21.         export.create(true, true);  
  22.           
  23.     }  
  24.       
  25. }