ibatis调用mysql存储过程出错,求解? 错误信息为: org.springframework.jdbc.UncategorizedSQLException:SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [S1009]; error code [0]; --- The error occurred while applying a parameter map. --- Check the callEmpTreeList-InlineParameterMap. --- Check the statement (update procedure failed). --- Cause: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
存储过程为: CREATE PROCEDURE `Pro_GetEmpTreeList`(in pid varchar(36)) begin declare lev int; set lev=1; drop table if exists tmp1; CREATE TABLE tmp1(id VARCHAR(40),employee_organname varchar(50),parentid varchar(40) ,levv INT); INSERT tmp1 SELECT id,employee_organname,parent_id,1 FROM `hr_employee` WHERE parent_id=pid; while row_count()>0 do set lev=lev+1; INSERT tmp1 SELECT t.id,t.employee_organname,t.parent_id,lev from hr_employee t join tmp1 a on t.parent_id=a.id AND levv=lev-1; end while ; INSERT tmp1 SELECT id,employee_organname,parent_id,0 FROM hr_employee WHERE id=pid; end 我这里为了测试就没传参数直接写死,直接在mysql中执行call Pro_GetEmpTreeList('4028804a274a8bb10128fd56877e4d44')是没有问题的,
一样的错误 org.springframework.jdbc.UncategorizedSQLException:SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [S1009]; error code [0]; --- The error occurred while applying a parameter map. --- Check the callEmpTreeList-InlineParameterMap. --- Check the statement (update procedure failed). --- Cause: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: