The method configure() is undefined for the type Configuration 5
publicstaticList<tel>getInfo(){Configurationcfg=newConfiguration();SessionFactorysf=c...
public static List<tel> getInfo(){
Configuration cfg=new Configuration();
SessionFactory sf = cfg.configure().buildSessionFactory();
org.hibernate.classic.Session session = sf.openSession();
org.hibernate.Query q=session.createQuery("from tel as c");
List<tel> l=q.list();
session.close();
sf.close();
return l;
} 展开
Configuration cfg=new Configuration();
SessionFactory sf = cfg.configure().buildSessionFactory();
org.hibernate.classic.Session session = sf.openSession();
org.hibernate.Query q=session.createQuery("from tel as c");
List<tel> l=q.list();
session.close();
sf.close();
return l;
} 展开
展开全部
Cannot instantiate the type Configuration
The method configure() is undefined for the type Configuration
SchemaExport cannot be resolved to a type
SchemaExport cannot be resolved to a type
这个的意思就是说:
1.类型Configuration不能定义方法configure()
2.SchemaExport不能审明一个变量
我想这个大概是你没有将Hibernate的jar包放入classes/lib下面吧,程序找不到就报错了,你再试试
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询