慕盖茨9419589
2017-12-09 17:48
package entity;
import java.util.Date;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.ServiceRegistryBuilder;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.junit.Test;
public class Teststudents
{
@Test
public void testschemaExport()
{
Configuration configuration=new Configuration().configure();
ServiceRegistry serviceRegistry=new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();
SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);
Session session=sessionFactory.getCurrentSession();
SchemaExport export=new SchemaExport(configuration);
export.create(true,true);
}
代码能出错的地方太多了.打开方式不一样都可能出错
看控制器啊.运行出来看下面的控制器怎怎么显示的
使用Struts2+Hibernate开发学生信息管理功能
80701 学习 · 754 问题
相似问题