wenthywang

本站不再维护,请前往最新网址:wenthywangtee.gitee.io

  • 首页
  • 文章归档
  • 默认分类
  • 关于页面

  • 搜索

Mybatis调用存储过程报错

发表于 2016-09-20 | 0 | 阅读次数 35

Mybatis调用存储过程

贴码

Error querying database.  Cause: java.sql.SQLException: User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with "noAccessToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types.
 The error may exist in resources/mapper/AgentStatisDao.xml
 The error may involve com.jiaxincloud.gw.statistics.dao.statistics.AgentStatisDao.callAgentVisitorManualStatisProcedure
 The error occurred while executing a query
 SQL: {CALL PRO_AGENT_VISITOR_MANUAL_STATIS(?,?,?)}
 Cause: java.sql.SQLException: User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with "noAccessToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types.

总结

跟着这个错误在网上找了一下,原来是该用户没有调用存储过程的权限,所以只要赋予proc的权限即可,亲测成功。在MySql中执行如下命令,授予权限。(user@host 是连接数据库的用户名,修改成连接数据库的用户名就行)

    grant select on mysql.proc to user@host;
    flush privileges;
  • 本文作者: wenthywang
  • 本文链接: https://wenthywang.cn/archives/mybatis调用存储过程报错
  • 版权声明: 本博客所有文章除特别声明外,均采用CC BY-NC-SA 3.0 许可协议。转载请注明出处!
hexo+github pages
git工程批量更新和自动提交
  • 文章目录
  • 站点概览
wenthywang

wenthywang

26 日志
1 分类
0 标签
RSS
Creative Commons
© 2020 — 2021 wenthywang
由 Halo 强力驱动