当前位置: 代码迷 >> J2EE >> org.springframework.jdbc.BadSqlGrammarException解决办法
  详细解决方案

org.springframework.jdbc.BadSqlGrammarException解决办法

热度:116   发布时间:2016-04-21 23:17:52.0
org.springframework.jdbc.BadSqlGrammarException
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [select count(customerPortid)  FROM CustomerPort cusPort,Customer customer,CustomerPortDetail cusPortDetail,Department depart WHERE cusPort.customerPortid = cusPortDetail.customerPortMainId AND cusPort.customerId = customer.idccustomerId AND depart.deptid = customer.branch ]; nested exception is com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: SELECT command denied to user 'idctest'@'121.14.117.169' for table 'CustomerPort'
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:97)
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.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:407)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:458)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:466)
at org.springframework.jdbc.core.JdbcTemplate.queryForList(JdbcTemplate.java:497)
at com.cnc.platform.frame.dao.jdbc.CRMJdbcFrameOptionsDao.selectAllCountBySql(CRMJdbcFrameOptionsDao.java:48)
at com.cnc.platform.frame.CRMFrameServiceImpl.selectAllCountBySql(CRMFrameServiceImpl.java:43)
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:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
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.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy37.selectAllCountBySql(Unknown Source)
at com.cnc.platform.frame.web.struts.BaseDispatchAction.initSelectPagesBySqlForCRM(BaseDispatchAction.java:1037)
at com.cnc.platform.rmm.web.struts.CarryCompanyPortAction.getStatisticsLs4CustomerPort(CarryCompanyPortAction.java:940)
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.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at com.cnc.platform.frame.web.struts.BaseDispatchAction.execute(BaseDispatchAction.java:201)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
  相关解决方案