利用Hibernate导出生成数据库表
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import junit.framework.TestCase;
public class CreateDB extends TestCase{
public void testCreateDB(){
Configuration cfg=new Configuration().configure("hibernate.cfg.xml");
SchemaExport export=new SchemaExport(cfg);
export.create(true, true);
}
}