background image
<< Specifying multiple tables | Drop and recreate your function >>

Using SignatureChecker

<< Specifying multiple tables | Drop and recreate your function >>
Derby Tools and Utilities Guide
63
SignatureChecker
Use the
SignatureChecker
tool to identify any SQL functions and procedures in a
database that do not follow the SQL argument matching rules described in "Argument
matching" in the Derby Reference Manual. If your application uses SQL functions and/or
procedures, you should run this tool against your databases.
Using SignatureChecker
Before you run the
SignatureChecker
tool, make sure that your classpath contains the
Derby jar files, including derbytools.jar.
On a Java SE platform, run the
SignatureChecker
tool as follows, where
connection-url-to-database is the connection URL you would use in order to obtain a
connection by calling DriverManager.getConnection():
java org.apache.derby.tools.SignatureChecker connection-url-to-database
Alternatively, you can invoke the tool using derbyrun.jar. For example:
java -jar derbyrun.jar SignatureChecker "jdbc:derby:myDB"
On a Java ME platform, run the
SignatureChecker
tool as follows,
where database-name is the database name you would set by calling
EmbeddedSimpleDataSource.setDatabaseName():
java org.apache.derby.tools.SignatureChecker database-name
The tool examines every routine registered in the database and displays results like the
following:
Found a matching method for: "APP"."DOINSERT"( )
Found a matching method for: "APP"."DOINSERTANDCOMMIT"( )
Found a matching method for: "APP"."APPENDFOOANDBAR"( VARCHAR )
Unresolvable routine: "APP"."IDONTEXIST"( VARCHAR , INTEGER ).
Detailed reason: No method was found that matched the method call
z.iDontExist(java.lang.String, int),
tried all combinations of object and primitive types and any possible
type conversion for any parameters the method call may have.
The method might exist but it is not public and/or static, or the
parameter types are not method invocation convertible.
Found a matching method for: "APP"."RUNDDL"( VARCHAR )
Unresolvable routine: "APP"."TABFUNCDOESNTEXIST"( VARCHAR , BIGINT ).
Detailed reason: No method was found that matched the method call
org.apache.derbyTesting.functionTests.tests.lang.TableFunctionTest.
appendFooAndBar(java.lang.String, long),
tried all combinations of object and primitive types and any possible
type conversion for any parameters the method call may have.
The method might exist but it is not public and/or static, or the
parameter types are not method invocation convertible.
In the example above, the
SignatureChecker
tool found matches for all routines
except for the functions app.iDontExist and app.tabFuncDoesntExist. If the tool cannot
find a match for one of your functions or procedures, it tells you what signature it
expected to find. You need to adjust your application in one of the following ways:
· Method: Change the signature of your Java method to match the signature
suggested by the
SignatureChecker
tool.