I've seen the stored procedure invocation documented as:
{call demoSp(?, ?)}
I'm building up my invocation string from JDBC metadata.
The PROCEDURE_CAT column is populated with the name of the database
url: jdbc:mysql://localhost:3306/emp
^^^ database name
// useful fields in databaseMetaData.getProcedures() ResultSet
public static final int PROCS_INFO_CATALOG = 1;//catalog (may be null)
...
ResultSet procsInfo = databaseMetaData.getProcedures(catalogPattern,
schemaPattern, procedurePattern);
String actualCatalogName = procsInfo.getString(PROCS_INFO_CATALOG);
^^^^^^^^^^^^^^^^^ contains "emp"
Thus, my invocation string becomes:
{call emp.demoSp(?, ?)}
In older versions of the Connector, this seemed to work; however, in
version 5.1.13 of Connector/J, I'm getting an exception:
Parameter index of n is out of range (a, b) {values n, a, b vary based on
number of arguments}
(and yes, I've opened a bug on this
http://bugs.mysql.com/bug.php?id=57183)
I can change my code to
not include the catalog name ... but is there ever
any circumstance under which it
does becomes required?
Thanks in advance,
Mike Norman