Mi collego a un database MySQL (5.08) in esecuzione su una macchina Linux da un'applicazione Web in esecuzione in tomcat.Impossibile eseguire una procedura memorizzata MySQL da Java
ottengo la seguente eccezione quando si tenta di eseguire una stored procedure:
com.hp.hpl.chaos.web.exception.DBException: getNextValue for operatorinstance[Additional Information from SQL Exception][SQLErrorCode: 0 SQLState: S1000
at com.hp.hpl.chaos.web.util.SQLUtil.getNextValue(SQLUtil.java:207)
..............
Caused by: 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.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
at com.mysql.jdbc.DatabaseMetaData.getCallStmtParameterTypes(DatabaseMetaData.java:1619)
at com.mysql.jdbc.DatabaseMetaData.getProcedureColumns(DatabaseMetaData.java:4034)
at com.mysql.jdbc.CallableStatement.determineParameterTypes(CallableStatement.java:709)
at com.mysql.jdbc.CallableStatement.<init>(CallableStatement.java:513)
at com.mysql.jdbc.Connection.parseCallableStatement(Connection.java:4583)
at com.mysql.jdbc.Connection.prepareCall(Connection.java:4657)
at com.mysql.jdbc.Connection.prepareCall(Connection.java:4631)
at com.hp.hpl.chaos.web.util.SQLUtil.getNextValue(SQLUtil.java:196)
... 17 more
Dopo l'installazione di MySQL sulla macchina. Ho dato le opzioni di finanziamento follwing per sradicare
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'pass';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
Nella classe java ..
Sto collegandomi al db come segue:
String url = "jdbc:mysql://ipaddress:3306/test";
con = DriverManager.getConnection(url,"root", "pass");
Ho provato anche l'url con la Opzione noAccessToProcedureBodies=true
inclusa.
Qualcuno può dirmi cosa c'è che non va qui? C'è qualcosa che devo controllare?
scusate la sovvenzione dovrebbe leggere *. * Invece di. –
Penso che i GRANT di MySQL non funzionino sempre come ci si potrebbe aspettare. A volte ho riscontrato che le cose funzionano se si utilizzano autorizzazioni GRANT specifiche anziché *. * – skaffman