互联网服务数据库javaSQL

java.sql.SQLException: Cannot add index.

求助:程序连接informix数据库的表:
使用java程序 执行:
StringBuffer sf=new StringBuffer();
                sf.append("select new com.jy.pjbj.dto.manhour.EvalQuickDefaultUserDTO(a.id,a.qybm,a.qymc,a.bz) " +
                                "from PjZdQyzdBd a,PjZdQyzd xtqy " +
                                "where a.scbz = '0' and xtqy.scbz = '0' and a.xtqyId = xtqy.id ");
                sf.append(" order by a.qybm ");
                List returnList = pm.getList(sf.toString());
就报如下错误:

org.springframework.jdbc.UncategorizedSQLException: (Hibernate operation): encountered SQLException [Cannot add index.]; nested exception is java.sql.SQLException: Cannot add index.   
   关闭详细信息   
  定损单号:P001
[SystemError]:org.springframework.jdbc.UncategorizedSQLException: (Hibernate operation): encountered SQLException [Cannot add index.]; nested exception is java.sql.SQLException: Cannot add index.
[Message]:(Hibernate operation): encountered SQLException [Cannot add index.]; nested exception is java.sql.SQLException: Cannot add index.
[Cause]:java.sql.SQLException: Cannot add index.
org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:94)
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:281)
org.springframework.orm.hibernate.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:249)
org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:231)
org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:233)
org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:248)
com.jy.framework.persistence.hibernate.HibernatePersistenceManager.getList(HibernatePersistenceManager.java:108)
com.jy.pjbj.service.manhour.impl.ManagerServiceImpl.getCompanyList(ManagerServiceImpl.java:762)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:154)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:121)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:143)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
$Proxy82.getCompanyList(Unknown Source)
com.jy.pjbj.web.action.manager.ManagerEditAction.execute(ManagerEditAction.java:65)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
------------

抓出Sql在数据库直接查询
select a.id,a.qybm,a.qymc,a.bz
from Pj_Zd_Qyzd_Bd a,Pj_Zd_Qyzd xtqy  
where a.scbz = '0' and xtqy.scbz = '0' and a.xtqyId = xtqy.id
                  order by a.qybm  
直接执行,可以正常查询,
高手帮忙给看下啊
参与7

7同行回答

新疆哈密新疆哈密系统工程师哈密市商业银行
回复 6# 小山猫     你怎么不明白,你执行System.out.println(sf),看这个sql语句正常吗?这个不正常其他的有什么用?显示全部
回复 6# 小山猫


    你怎么不明白,你执行System.out.println(sf),看这个sql语句正常吗?这个不正常其他的有什么用?收起
政府机关 · 2010-10-28
浏览3234
小山猫小山猫软件开发工程师北京
而且这快程序涉及到的东西,是只涉及到select查询,不涉及到加index显示全部
而且这快程序涉及到的东西,是只涉及到select查询,不涉及到加index收起
互联网服务 · 2010-10-28
浏览3148
小山猫小山猫软件开发工程师北京
程序 调用的是 select a.id,a.qybm,a.qymc,a.bz from Pj_Zd_Qyzd_Bd a,Pj_Zd_Qyzd xtqy  where a.scbz = '0' and xtqy.scbz = '0' and a.xtqyId = xtqy.id                   order by a.qybm&n...显示全部
程序 调用的是 select a.id,a.qybm,a.qymc,a.bz
from Pj_Zd_Qyzd_Bd a,Pj_Zd_Qyzd xtqy  
where a.scbz = '0' and xtqy.scbz = '0' and a.xtqyId = xtqy.id
                  order by a.qybm  
这个在后台数据库执行的时候,是没有问题的,可以正常访问收起
互联网服务 · 2010-10-28
浏览3395
新疆哈密新疆哈密系统工程师哈密市商业银行
你这样做,你不是定义了StringBuffer sf=new StringBuffer();你执行System.out.println(sf),然后在控制台你sql语句复制出来,你执行看有没有问题。没有你在看你的 List returnList = pm.getList(sf.toString());你看你的getList方法,有没有问题。...显示全部
你这样做,你不是定义了StringBuffer sf=new StringBuffer();
你执行System.out.println(sf),然后在控制台你sql语句复制出来,你执行看有没有问题。没有你在看你的 List returnList = pm.getList(sf.toString());你看你的getList方法,有没有问题。收起
政府机关 · 2010-10-28
浏览3182
feipigfeipig软件架构设计师HCXT
以前听说过Hibernate访问的表都需要有主键的,加个主键试试.显示全部
以前听说过Hibernate访问的表都需要有主键的,加个主键试试.收起
系统集成 · 2010-10-28
浏览3260
liaosnetliaosnet信息分析/架构师gbasedbt.com
encountered SQLException [Cannot add index.]; nested exception is java.sql.SQLException: Cannot add index.  错误的不是这吧。。。。指示的错误明显是说建index失败。。显示全部
encountered SQLException [Cannot add index.]; nested exception is java.sql.SQLException: Cannot add index.  


错误的不是这吧。。。。指示的错误明显是说建index失败。。收起
IT咨询服务 · 2010-10-28
浏览3159
忧愁绽放忧愁绽放系统工程师zznode
纯支持,不会编程的人飘过。。。。。显示全部
纯支持,不会编程的人飘过。。。。。收起
电信设备制造商 · 2010-10-28
浏览3222

提问者

小山猫
软件开发工程师北京

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2010-10-28
  • 关注会员:0 人
  • 问题浏览:10091
  • 最近回答:2010-10-28
  • X社区推广