当前位置: 代码迷 >> Java Web开发 >> mybatis的报错…ORA-00911: 无效字符,该怎么解决
  详细解决方案

mybatis的报错…ORA-00911: 无效字符,该怎么解决

热度:596   发布时间:2016-04-12 23:04:54.0
mybatis的报错……ORA-00911: 无效字符
xml里的配置

<select id="findLocalPeopleSfzh" parameterType="com.tzyt.common.model.PageMap"
    resultType="java.lang.String">
    select t.sfzh from t_ldrk t 
<trim prefix="where" prefixOverrides="and|or">
     <if test="condition  != null and condition.differDay  != null">
    and t.djrq > (sysdate - #{condition.differDay}) 
      </if>
    and t.djrq 
    <![CDATA[ < ]]> 
    sysdate;
    </trim>
  </select>

运行报错:

org.springframework.jdbc.BadSqlGrammarException
### Error querying database.  Cause: java.sql.SQLException: ORA-00911: 无效字符

### The error may involve com.tzyt.people.dao.PeopleMapper.findLocalPeopleSfzh-Inline
### The error occurred while setting parameters
### Cause: java.sql.SQLException: ORA-00911: 无效字符

; bad SQL grammar []; nested exception is java.sql.SQLException: ORA-00911: 无效字符

at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:98)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:346)
at $Proxy9.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:189)
at org.apache.ibatis.binding.MapperMethod.executeForList(MapperMethod.java:100)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:70)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:38)
at $Proxy25.findLocalPeopleSfzh(Unknown Source)
at com.tzyt.people.service.impl.PeopleServiceImpl.findLocalPeopleSfzh(PeopleServiceImpl.java:1036)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy41.findLocalPeopleSfzh(Unknown Source)
at com.tzyt.people.junit.PeopleTest.testGetAdminPopedomDetail(PeopleTest.java:42)
  相关解决方案