a6877321
RYCookie
2017-02-25 02:55

Hibernate连接数据库出错

5
  • hql
  • oracle
  • 数据库
  • hibernate
  • 异常

为什么我的hibernate都能查询oracle数据库里面的东西,也执行了hql语句,但是在query.list()的时候会报错,是不是驱动错了?求大神指点一下啊,下面的是异常

org.hibernate.exception.GenericJDBCException: could not execute query
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
org.hibernate.loader.Loader.doList(Loader.java:2235)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
org.hibernate.loader.Loader.list(Loader.java:2124)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
com.sneaker.daoimpl.CustomerDaoImpl.login(CustomerDaoImpl.java:29)
com.sneaker.service.CustomerService.login(CustomerService.java:20)
com.sneaker.action.CustomerAction.login(CustomerAction.java:42)
.....

java.sql.SQLException: ????
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
oracle.jdbc.driver.NumberCommonAccessor.throwOverflow(NumberCommonAccessor.java:7465)
oracle.jdbc.driver.NumberCommonAccessor.getInt(NumberCommonAccessor.java:103)
oracle.jdbc.driver.OracleResultSetImpl.getInt(OracleResultSetImpl.java:521)
oracle.jdbc.driver.OracleResultSet.getInt(OracleResultSet.java:1563)
org.apache.commons.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:236)
org.hibernate.type.IntegerType.get(IntegerType.java:51)
org.hibernate.type.NullableType.nullSafeGet(NullableType.java:184)
org.hibernate.type.NullableType.nullSafeGet(NullableType.java:173)
org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2114)
org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
org.hibernate.loader.Loader.getRow(Loader.java:1230)
org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
org.hibernate.loader.Loader.doQuery(Loader.java:724)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
org.hibernate.loader.Loader.doList(Loader.java:2232)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
org.hibernate.loader.Loader.list(Loader.java:2124)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
com.sneaker.daoimpl.CustomerDaoImpl.login(CustomerDaoImpl.java:29)
com.sneaker.service.CustomerService.login(CustomerService.java:20)
com.sneaker.action.CustomerAction.login(CustomerAction.java:42)
...

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

9条回答