There was a sudden error in testing the project today.
User does not has access to metadata required to determine stored procedure parameter types. If rights can not is granted, configure connection with "Noaccesstoprocedurebodies=true" to has driver generate parameter s that represent INOUT strings irregardless of actual parameter types.
The simple explanation is that JDBC calls the stored procedure not only for the user to have Execute permission, but also to have access to mysql.proc. Otherwise it cannot access the metadata.
There are two ways to resolve the discovery data:
One: Set a Noaccesstoprocedurebodies property to the database connection, the property value is True
eg
Jdbc:mysql://192.168.1.111:3306/test?
Online says setting up Noaccesstoprocedurebodies=true will bring some impact (not verified):
1. When a stored procedure is called, no type checking is set to the string type, and all arguments are set to the int type, but no exception is thrown when Registeroutparameter is called.
2. The query results of a stored procedure cannot be obtained using GETXXX (String parametername) and can only be obtained by getxxx (int parameterindex).
Second: assigning rights to the database user, assigning the SELECT permission to execute the MYSQL.PROC table
eg
GRANT SELECT on Mysql.proc to ' user ' @ ' localhost ';
JDBC Connection execution MySQL stored procedure report permission error