0
喜在執行下面的查詢我得到DataException:DataException無法執行查詢
GET_USERLIST_BY_GROUP1 = " SELECT usr.user_id,
usr.login_name
FROM user_info usr
WHERE usr.user_id IN
(SELECT g.user_id
FROM group_privilege_details g
WHERE g.group_id IN
(SELECT gp.group_id
FROM group_privilege_details gp,
user_info u
WHERE u.user_id=gp.user_id
AND u.login_name=?)
GROUP BY g.user_id HAVING count(g.group_id) =
(SELECT count(g.group_id)
FROM group_privilege_details gr,
user_info us
WHERE us.user_id=gr.user_id
AND us.login_name=?))
AND usr.login_name!=?"
請找到一塊Hibernate代碼:
qry = hiberSession.createSQLQuery(GET_USERLIST_BY_GROUP1);
qry.setParameter(0, argUsername);
qry.setParameter(1, argUsername);
qry.setParameter(2, argUsername);
lstUsernamebyGroup = qry.list();
請找我的例外:
2011-10-22 12:42:55,352 INFO [STDOUT] (http-10.128.15.228-8080-5) org.hibernate.exception.DataException: could not execute query
2011-10-22 12:42:55,352 INFO [STDOUT] (http-10.128.15.228-8080-5) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
2011-10-22 12:42:55,352 INFO [STDOUT] (http-10.128.15.228-8080-5) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
2011-10-22 12:42:55,353 INFO [STDOUT] (http-10.128.15.228-8080-5) at org.hibernate.loader.Loader.doList(Loader.java:2223)
2011-10-22 12:42:55,353 INFO [STDOUT] (http-10.128.15.228-8080-5) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
2011-10-22 12:42:55,353 INFO [STDOUT] (http-10.128.15.228-8080-5) at org.hibernate.loader.Loader.list(Loader.java:2099)
2011-10-22 12:42:55,354 INFO [STDOUT] (http-10.128.15.228-8080-5) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
2011-10-22 12:42:55,354 INFO [STDOUT] (http-10.128.15.228-8080-5) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
2011-10-22 12:42:55,354 INFO [STDOUT] (http-10.128.15.228-8080-5) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
2011-10-22 12:42:55,355 INFO [STDOUT] (http-10.128.15.228-8080-5) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
2011-10-22 12:42:55,355 INFO [STDOUT] (http-10.128.15.228-8080-5) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
您錯過了異常消息,這無疑將解釋發生了什麼問題... –
添加了異常。請查找 – Nila
是否沒有嵌套異常?我希望那裏有... –