Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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

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 .

share|improve this question

1 Answer 1

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:

  1. The GRANT statement you tried
  2. 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.

share|improve this answer
    
I also tried 2nd option String connectionURL = "jdbc:mysql://localhost:3306/database?user=user_name&password=password&noAccessT‌​oProcedureBodies=true"; and Connection c = DriverManager.getConnection(connectionURL); but still showing same error. –  user2302288 Jun 26 '13 at 12:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.