Note that there are some explanatory texts on larger screens.

plurals
  1. POstored procedures executed through jdbc
    primarykey
    data
    text
    <p>I've created some stored procedures on a mysql database, but when I try to execute them I get: </p> <pre><code>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. </code></pre> <p>I added to my connection string noAccessToProcedureBodies=true, but I still get this message. I use the DriverManager.getConnection(url, user, password) method, and the url I use is</p> <pre><code>jdbc:mysql://[server-url]/[database-name]?noAccessToProcedureBodies=true </code></pre> <p>EDIT: what I meant was that I have a user, called creautenti, that I use in this method to create new users:</p> <pre><code>public static boolean creazioneUtente(String user, String password) throws EccezioneDaMostrare{ if(apriConnessione(CREA_UTENTI_USER, CREA_UTENTI_PW, false)){ try{ conn.setAutoCommit(false); String sqlCommand="CREATE USER ? @'%' IDENTIFIED BY PASSWORD ?"; String sqlCommandGrant="GRANT EXECUTE ON salvataggi.* TO ? REQUIRE SSL;"; String sqlCommandGrantEx="GRANT SELECT ON `mysql`.`proc` TO ? @'%';"; PreparedStatement s=conn.prepareStatement(sqlCommand); PreparedStatement sGrant=conn.prepareStatement(sqlCommandGrant); PreparedStatement sGrantEx=conn.prepareStatement(sqlCommandGrantEx); s.setString(1, user); sGrant.setString(1, user); sGrantEx.setString(1, user); s.setString(2, mySQLPASSWORD(password)); s.execute(); sGrant.executeUpdate(); sGrantEx.executeUpdate(); conn.commit(); conn.setAutoCommit(true); chiudiConnessione(); return true; } catch(SQLException e){ try { conn.rollback(); } catch (SQLException e1) { String msg=String.format("Errore durante la connessione al server MySQL:\n Messaggio:%s \n Stato SQL:%s \n Codice errore:%s", e.getMessage(), e.getSQLState(), e.getErrorCode()); throw new EccezioneDaMostrare(msg); } chiudiConnessione(); return false; } } else return false; } </code></pre> <p>(the first line just opens a connection with the server as creautenti, and conn is the Connection object). So I logged in as root on the server, and called </p> <pre><code>GRANT SELECT ON `mysql`.`proc` TO 'creautenti'@'%' WITH GRANT OPTION; </code></pre> <p>which updated creautenti's privileges accordingly, but when I call </p> <pre><code>GRANT SELECT ON `mysql`.`proc` TO '&lt;username&gt;'@'%'; </code></pre> <p>logged in as creautenti on any other user, the privileges aren't modified. All the routines are in salvataggi, on which I give EXECUTE privileges to every user, so I don't think that's the problem either. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload