Parameter number X is not an OUT parameter
2015-07-14 00:00
681 查看
摘要: 解决java.sql.SQLException: Parameter number X is not an OUT parameter
开发过程中遇到这个问题,试着按网上的方式解决:
http://blog.csdn.net/lutinghuan/article/details/9271311
只能说然并卵。
其实,有可能是连接mysql的用户没有procedure的执行权限导致的。
此次我碰到的问题就是这样,记录下来!
没有授予EXECUTE的权限,也是报出如下的错误:
如果不授予
开发过程中遇到这个问题,试着按网上的方式解决:
http://blog.csdn.net/lutinghuan/article/details/9271311
只能说然并卵。
其实,有可能是连接mysql的用户没有procedure的执行权限导致的。
此次我碰到的问题就是这样,记录下来!
GRANT EXECUTE ON ichson_lore_source.* TO 'loresource_opr'@'%'; GRANT SELECT ON `mysql`.`proc` TO 'loresource_opr'@'%'
没有授予EXECUTE的权限,也是报出如下的错误:
### Cause: java.sql.SQLException: Parameter number 2 is not an OUT parameter ; SQL []; Parameter number 2 is not an OUT parameter; nested exception is java.sql.SQLException: Parameter number 2 is not an OUT parameter org.springframework.dao.TransientDataAccessResourceException: ### Error querying database. Cause: java.sql.SQLException: Parameter number 2 is not an OUT parameter ### The error may exist in file [/data/loresource-tomcat/work/Catalina/localhost/_/WEB-INF/classes/sql-mapping/sequence.xml] ### The error may involve com.ichson.loresource.repo.SequenceRepo.querySeq ### The error occurred while executing a query ### SQL: {call next_val( ?, ?, ?, ? )} ### Cause: java.sql.SQLException: Parameter number 2 is not an OUT parameter ; SQL []; Parameter number 2 is not an OUT parameter; nested exception is java.sql.SQLException: Parameter number 2 is not an OUT parameter
如果不授予
mysql.
proc的权限,会报metadata没有权限的问题。
### Cause: java.sql.SQLException: User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configur e connection with "noAccessToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types. ; SQL []; User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with "noAcc essToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types.; nested exception is java.sql.SQLEx ception: User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with "noAcce ssToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types. org.springframework.dao.TransientDataAccessResourceException: ### Error querying database. Cause: java.sql.SQLException: User does not have access to metadata required to determine stored procedure parameter types. If rights ca n not be granted, configure connection with "noAccessToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual pa rameter types. ### The error may exist in file [/data/loresource-tomcat/work/Catalina/localhost/_/WEB-INF/classes/sql-mapping/sequence.xml] ### The error may involve com.ichson.loresource.repo.SequenceRepo.querySeq ### The error occurred while executing a query ### SQL: {call next_val( ?, ?, ?, ? )} ### Cause: java.sql.SQLException: User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configur e connection with "noAccessToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types. ; SQL []; User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with "noAcc essToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types.; nested exception is java.sql.SQLEx ception: 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.
相关文章推荐
- 如何在几何画板中构造正五边形
- Java设计模式原则
- Jenkins Failed to archive test report
- 腾讯SNG 7月25日——开发类专场招聘会
- mvc的学习
- git 命令大全
- Leetcode #40 Combination Sum II
- linux下串口编程简单实例
- STM32串口多机通信
- web deploy 部署到远程服务器(win server 2008 r2) 遇到的问题。。。。
- 学游戏开发,就是这么牛!
- 三伏天要如何防中暑
- ubutun14伪分布安装hadoop-2.6.0
- JSONArray的合并
- python 安装MySQLdb模块
- cookie生命周期及路径问题
- js测试网络连通情况
- Android中View的绘制过程 onMeasure方法简述 附有自定义View例子
- java编码规范
- 【OM】 如何保持进程挂了自动重启?