Using mysql 5.0.18 I find that I cannot use the procedure
in the mysql-connector-java documention to call stored procedures.
The error I get is
Driver requires declaration of procedure to either contain a
'\nbegin' or '\n' to follow argument declaration, or SELECT
privilege on mysql.proc to parse column types.
I've looked around and found lots of other complaints about this,
and a number of suggested solutions that all seem to miss the point.
The error is coming from the driver trying to find out about the
parameters of the procedure by examining its definition.
It sends the following command to the DB:
SHOW CREATE PROCEDURE procedurename
In the mysql version I'm using, this returns
| Procedure | sql_mode | Create Procedure |
| procedurename | | |
for all the other users (I want them to use it).
So far I don't see how to let them see the definition.
Can someone tell me how to do that? I've tried a bunch of things
including several of the aforementioned solutions that don't work.
Naturally I'd like to grant them as few other priv's as possible.
However, I really think this is the wrong approach. Wouldn't it be
better if I could simply declare the types? I think the person who
provides the procedure should be willing to give the caller these
types, but I don't see why he should have to provide the entire
definition.
I notice that CallableStatement.java contains
public CallableStatement(Connection conn,
CallableStatementParamInfo paramInfo) throws SQLException {
super(conn, paramInfo.nativeSql, paramInfo.catalogInUse);
this.paramInfo = paramInfo;
this.callingStoredFunction = this.paramInfo.isFunctionCall;
if (this.callingStoredFunction) {
this.parameterCount += 1;
}
}
So maybe we could be given a way to create one of those paramInfo
objects?
| Thread |
|---|
| • stored procedure and SHOW CREATE PROCEDURE | (Don Cohen) | 23 Dec |