因为我没有数据库基础,学起来比较痛苦我用下面的代码显示内容结果报错代码为
ession session = HibernateSessionFactory.currentSession();
Transaction tx = session.beginTransaction();Query query = session.createQuery("select t from Teamone as t ");Iterator it = query.iterate();
while(it.hasNext()){
Teamone st=(Teamone)it.next();
System.out.println("id=="+st.getId()+""+"name="+st.getName());
} tx.commit(); session.close();错误是
java.lang.NoClassDefFoundError: antlr/ANTLRException
at org.hibernate.hql.ast.ASTQueryTranslatorFactory.createQueryTranslator(ASTQueryTranslatorFactory.java:27)
at org.hibernate.impl.SessionFactoryImpl.createQueryTranslators(SessionFactoryImpl.java:357)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:423)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884)
at org.hibernate.impl.SessionImpl.iterate(SessionImpl.java:920)
at org.hibernate.impl.QueryImpl.iterate(QueryImpl.java:41)
at com.airhork.hibernate.test.InsertTest.main(InsertTest.java:37)
Exception in thread "main" 
请问是怎么回事?
多谢