日期:2014-05-17  浏览次数:20828 次

ORA-00911: 无效字符 。 求高手解答。

              List ulist = new ArrayList();
try {
String sql = null;
if(ischer == 1)
{
sql="select  t_resource.id, t_resource.penid, t_resource.bookid,     t_resource.userid ,t_dpt.deptname " +
" from t_resource,t_users,t_dpt  where  t_resource.userid= t_users.username  " +
" and t_users.deptid= t_dpt .deptid ;";
// sql="select id,acceptbranch1,inqueststartyear,inqueststartmonth,inqueststartdate," +
// "inqueststarthour,inqueststartmin,inquestendyear,inquestendmonth,inquestenddate," +
// "inquestendhour,inquestendmin,sitecity,siteother,assignedpeople,acceptbranch2," +
// "ischeck,penid,bookid from T_PAGE1 " +
// "where ischeck in (0,1,2) order by id asc";
}










错误信息是 :



org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2223)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
at com.haibo.manage.dao.core.HibernateEntityDao$1.doInHibernate(HibernateEntityDao.java:147)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:342)
at com.haibo.manage.dao.core.HibernateEntityDao.getInfoList(HibernateEntityDao.java:138)
at com.haibo.manage.dao.TPage1Dao.getInfo1(TPage1Dao.java:107)
at com.haibo.manage.dao.TPage1Dao.firstRequest(TPage1Dao.java:162)
at com.haibo.manage.dao.TPage1Dao$$FastClassByCGLIB$$fa9c87fd.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:696)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:631)
at com.haibo.manage.dao.TPage1Dao$$EnhancerByCGLIB$$9313ac5b.firstRequest(<generated>)
at com.haibo.manage.service.TPage