ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikel sanchez <mikel.sanchez...@gmail.com>
Subject Re: invalid column index (urgent)
Date Sat, 21 Nov 2009 16:10:24 GMT
I'm not sure, but could it be that in

<select id="getBusinessUnitsContainsListCount"
 parameterMap="buEditParamMap"  resultMap="businessUnitsEditParameters">
        SELECT * FROM table name WHERE PRTY_ID=#partyId# AND STATUS='A'
        AND LIST_TYPE='BUSINESS' AND UPPER(name) LIKE UPPER('%'||#buName#||'%')

</select>

the property buName is not being properly joined with the string '%'  ?

I usually change the property value from code, before calling the
statement. That is:
           buName = "%" + buName + "%"

and the statement remains the same without the %:
            .......LIKE UPPER(#buName#)



2009/11/21 helpmeplzplz <nirmala.pelluru@gmail.com>:
>
> Hi ALL,
>
> <typeAlias alias="businessUnitsEditsParameters"
>                type="com.everbridge.aware.ui.MembersDisplayBean" />
>
> <typeAlias alias="businessUnitEditsParameters"
>                type="com.everbridge.aware.ui.MemberSearchParameters" />
>
> <parameterMap id="buEditParamMap" class="businessUnitEditsParameters">
>                <parameter property="buName" />
>                <parameter property="partyId" />
>                <parameter property="sortClause" />
>  </parameterMap>
>
> <resultMap id="businessUnitsEditParameters"
> class="businessUnitsEditsParameters">
>                <result property="id" column="ID" />
>                <result property="buName" column="NAME" />
>        </resultMap>
>
> <select id="getBusinessUnitsContainsList" parameterMap="buEditParamMap"
> resultMap="businessUnitsEditParameters">
>        select * from (select innerQ.*,ROWNUM rn from(SELECT * FROM tablename WHERE
> PRTY_ID=#partyId# AND STATUS='A'
>        AND LIST_TYPE='BUSINESS' AND UPPER(name) LIKE UPPER('%'||#buName#||'%')
>        <isNotEmpty property="sortClause">
>                        <![CDATA[
>                       ORDER BY $sortClause$
>                        ]]>
>                </isNotEmpty>
>        )innerQ where ROWNUM <![CDATA[ <= ]]> #selectMaxValue#) outerQ where
rn
> <![CDATA[ > ]]> #selectMinValue#
>        </select>
>
>
>
>
>
>
>        <select id="getBusinessUnitsContainsListCount"
> parameterMap="buEditParamMap"  resultMap="businessUnitsEditParameters">
>        SELECT * FROM table name WHERE PRTY_ID=#partyId# AND STATUS='A'
>        AND LIST_TYPE='BUSINESS' AND UPPER(name) LIKE UPPER('%'||#buName#||'%')
>
>        </select>
>
>
>
>
> For this query i am getting invalid column index .
>
> But i am not getting that why it is giving error like that
>
>
> org.springframework.jdbc.InvalidResultSetAccessException: SqlMapClient
> operation; invalid ResultSet access for SQL []; nested exception is
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in com/everbridge/aware/ui/MemberManagement.xml.
> --- The error occurred while applying a parameter map.
> --- Check the MemberManagement.buEditParamMap.
> --- Check the parameter mapping for the 'buName' property.
> --- Cause: java.sql.SQLException: Invalid column index
> Caused by: java.sql.SQLException: Invalid column index
> Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in com/everbridge/aware/ui/MemberManagement.xml.
> --- The error occurred while applying a parameter map.
> --- Check the MemberManagement.buEditParamMap.
> --- Check the parameter mapping for the 'buName' property.
> --- Cause: java.sql.SQLException: Invalid column index
> Caused by: java.sql.SQLException: Invalid column index
>        at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:185)
>        at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
>        at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:614)
>        at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:588)
>        at
> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
>        at
> org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:268)
>        at
> org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:193)
>        at
> org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:219)
>        at
> org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:266)
>        at
> com.everbridge.aware.ui.spi.MemberSearchDao.buSearchCriteriaContains(MemberSearchDao.java:342)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:324)
>        at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
>        at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
>        at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
>        at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
>        at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
>        at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
>        at $Proxy7.buSearchCriteriaContains(Unknown Source)
>        at
> com.everbridge.aware.services.TestCreateBusinessUnit.testBuConatins(TestCreateBusinessUnit.java:64)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:324)
>        at junit.framework.TestCase.runTest(TestCase.java:154)
>        at junit.framework.TestCase.runBare(TestCase.java:127)
>        at junit.framework.TestResult$1.protect(TestResult.java:106)
>        at junit.framework.TestResult.runProtected(TestResult.java:124)
>        at junit.framework.TestResult.run(TestResult.java:109)
>        at junit.framework.TestCase.run(TestCase.java:118)
>        at junit.framework.TestSuite.runTest(TestSuite.java:208)
>        at junit.framework.TestSuite.run(TestSuite.java:203)
>        at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
>        at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Caused by: java.sql.SQLException: Invalid column index
>        at
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
>        at
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
>        at
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
>        at
> oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4754)
>        at
> oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4717)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:324)
>        at
> com.ibatis.common.jdbc.logging.PreparedStatementLogProxy.invoke(PreparedStatementLogProxy.java:70)
>        at $Proxy13.setString(Unknown Source)
>        at
> com.ibatis.sqlmap.engine.type.StringTypeHandler.setParameter(StringTypeHandler.java:30)
>        at
> com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameter(BasicParameterMap.java:165)
>        at
> com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameters(BasicParameterMap.java:125)
>        at
> com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:180)
>        at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
>        at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
>        ... 39 more
>
> Caused by:
> java.sql.SQLException: Invalid column index
>        at
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
>        at
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
>        at
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
>        at
> oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:4754)
>        at
> oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:4717)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:324)
>        at
> com.ibatis.common.jdbc.logging.PreparedStatementLogProxy.invoke(PreparedStatementLogProxy.java:70)
>        at $Proxy13.setString(Unknown Source)
>        at
> com.ibatis.sqlmap.engine.type.StringTypeHandler.setParameter(StringTypeHandler.java:30)
>        at
> com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameter(BasicParameterMap.java:165)
>        at
> com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameters(BasicParameterMap.java:125)
>        at
> com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:180)
>        at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
>        at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
>        at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
>        at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:614)
>        at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:588)
>        at
> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
>        at
> org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:268)
>        at
> org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:193)
>        at
> org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:219)
>        at
> org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:266)
>        at
> com.everbridge.aware.ui.spi.MemberSearchDao.buSearchCriteriaContains(MemberSearchDao.java:342)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:324)
>        at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
>        at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
>        at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
>        at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
>        at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
>        at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
>        at $Proxy7.buSearchCriteriaContains(Unknown Source)
>        at
> com.everbridge.aware.services.TestCreateBusinessUnit.testBuConatins(TestCreateBusinessUnit.java:64)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:324)
>        at junit.framework.TestCase.runTest(TestCase.java:154)
>        at junit.framework.TestCase.runBare(TestCase.java:127)
>        at junit.framework.TestResult$1.protect(TestResult.java:106)
>        at junit.framework.TestResult.runProtected(TestResult.java:124)
>        at junit.framework.TestResult.run(TestResult.java:109)
>        at junit.framework.TestCase.run(TestCase.java:118)
>        at junit.framework.TestSuite.runTest(TestSuite.java:208)
>        at junit.framework.TestSuite.run(TestSuite.java:203)
>        at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
>        at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>
> plz give me reply it is very urgent for me
>
> thanks in advance.
> --
> View this message in context: http://old.nabble.com/invalid-column-index--%28urgent%29-tp26457825p26457825.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message