patternsqlMinor
Not able to access stored procedure from my application
Viewed 0 times
storedapplicationprocedurefromnotaccessable
Problem
I have written few stored procedures and executed in my server that is having php myadmin now while calling this stored procedure from my application it is showing
following exception
While searching i find following query to resolve this exception:
my problem is that while running this query i am getting following error
but i have given all permission to user
So how to access stored procedure from my application
I am using shared hosting server .
following exception
SQLException1 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.While searching i find following query to resolve this exception:
GRANT SELECT,INSERT,UPDATE ON mysql.proc TO 'user'@'localhost';my problem is that while running this query i am getting following error
#1142 - SELECT,INSERT,UP command denied to user 'qqq'@'localhost' for table 'proc'but i have given all permission to user
GRANT ALL ON *.* TO 'qqq'@'localhost';So how to access stored procedure from my application
I am using shared hosting server .
Solution
The error you provided is generated by your driver. See this question, which points you to a blog entry giving an answer. To sum it up, you have two options:
Since you are using a shared hosting server it is likely that you don't have privileges on mysql.proc and you don't have root access to the server, so you can't GRANT them. Therefore you should try the second approach.
- The GRANT statement you tried
- adding noAccessToProcedureBodies=true to your database connection string (which is also suggested by the error message)
Since you are using a shared hosting server it is likely that you don't have privileges on mysql.proc and you don't have root access to the server, so you can't GRANT them. Therefore you should try the second approach.
Context
StackExchange Database Administrators Q#45272, answer score: 2
Revisions (0)
No revisions yet.