This class shows which user declared SQL functions and procedures cannot be matched with Java methods.
To run from the command-line, enter the following if running on J2SE:
java org.apache.derby.tools.SignatureChecker CONNECTION_URL_TO_DATABASE
And enter the following if running on J2ME:
java org.apache.derby.tools.SignatureChecker DATABASE_NAME
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final ArrayList | |
| private static LocalizedResource | |
| private final SignatureChecker. | |
| private final ArrayList | |
| private static final String[] | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | checkSignature(Connection
The connection to the database conn, String The SQL to prepare query, String the signature: printed if prepare fails readableSignature)Prepared a routine invocation in order to check whether it matches a Java method. |
| private void | countFunctionArgs(DatabaseMetaData
the database metadata of the database dbmd)Count up the arguments to the user-coded procedures. |
| private void | countProcedureArgs(DatabaseMetaData
the database metadata of the database dbmd)
Count up the arguments to the user-coded procedures in
|
| private void | execute()
Get a connection to a database and then match the signatures of routines in that database. |
| private void | findFunctions(DatabaseMetaData
the database metadata of the database dbmd)Find all of the user-declared functions. |
| private void | findProcedures(DatabaseMetaData
the database metadata of the database dbmd)Find all of the user-declared procedures. |
| private static String | Returns: A localized messageThe message key by which we located the localized text key, Object... Any arguments to the localized text to be filled in args)Format a localizable message. |
| private SignatureChecker. | Returns: a function descriptorThe index of the procedure in idx)_functions.Get a function descriptor from |
| private Connection | Returns: a connection to the databaseWe use reflection to get the J2SE connection so that references to DriverManager will not generate linkage errors on old J2ME platforms which may resolve references eagerly. |
| private static LocalizedResource | |
| private SignatureChecker. | Returns: a procedure descriptorThe index of the procedure in idx)_procedures.Get a procedure descriptor from |
| private boolean | Returns: true if the schema is a system schemathe schema to check schema)Return true if the schema is a system schema. |
| public static void | |
| private String | Returns: human readable stringthe routine for which we want a signature routineMake a human readable signature for a routine. |
| private void | matchFunctions(Connection
The connection to use to access the database conn)Match the signatures of functions in this database. |
| private void | matchProcedures(Connection
The connection to use to access the database conn)Match the signatures of procedures in this database. |
| private void | matchSignatures(Connection
This connection conn)Match the signatures of routines in the database attached to this connection. |
| private PreparedStatement | |
| private static void | |
| private static void | |
| private static void | |
| private void | putFunction(String
The schema of the function schema, String The name of the function name, boolean true iff the function is a table functionStore a function descriptor. |
| private void | putProcedure(String
schema of the procedure schema, String of a procedure name)Store a procedure descriptor. |
| _debugging | back to summary |
|---|---|
| private final boolean _debugging | |
| _functions | back to summary |
|---|---|
| private final ArrayList<SignatureChecker. | |
| _messageFormatter | back to summary |
|---|---|
| private static LocalizedResource _messageFormatter | |
| _parsedArgs | back to summary |
|---|---|
| private final SignatureChecker. | |
| _procedures | back to summary |
|---|---|
| private final ArrayList<SignatureChecker. | |
| SYSTEM_SCHEMAS | back to summary |
|---|---|
| private static final String[] SYSTEM_SCHEMAS | |
| WILDCARD | back to summary |
|---|---|
| private static final String WILDCARD | |
| SignatureChecker | back to summary |
|---|---|
| private SignatureChecker(SignatureChecker. | |
| checkSignature | back to summary |
|---|---|
| private void checkSignature(Connection conn, String query, String readableSignature) Prepared a routine invocation in order to check whether it matches a Java method.
| |
| countFunctionArgs | back to summary |
|---|---|
| private void countFunctionArgs(DatabaseMetaData dbmd) throws SQLException
Count up the arguments to the user-coded procedures. We use
reflection to look up the getFunctionColumns() method because that
method does not appear in the JSR169 api for DatabaseMetaData.
Update
| |
| countProcedureArgs | back to summary |
|---|---|
| private void countProcedureArgs(DatabaseMetaData dbmd) throws SQLException
Count up the arguments to the user-coded procedures in
| |
| execute | back to summary |
|---|---|
| private void execute() Get a connection to a database and then match the signatures of routines in that database. | |
| findFunctions | back to summary |
|---|---|
| private void findFunctions(DatabaseMetaData dbmd) throws SQLException
Find all of the user-declared functions. We use reflection to get our
hands on getFunctions() because that method does not appear in
the JSR169 api for DatabaseMetaData. Update
| |
| findProcedures | back to summary |
|---|---|
| private void findProcedures(DatabaseMetaData dbmd) throws SQLException Find all of the user-declared procedures.
| |
| formatMessage | back to summary |
|---|---|
| private static String formatMessage(String key, Object... args) Format a localizable message. | |
| getFunction | back to summary |
|---|---|
| private SignatureChecker. Get a function descriptor from
| |
| getJ2SEConnection | back to summary |
|---|---|
| private Connection getJ2SEConnection() throws SQLException We use reflection to get the J2SE connection so that references to DriverManager will not generate linkage errors on old J2ME platforms which may resolve references eagerly.
| |
| getMessageFormatter | back to summary |
|---|---|
| private static LocalizedResource getMessageFormatter() Get the message resource.
| |
| getProcedure | back to summary |
|---|---|
| private SignatureChecker. Get a procedure descriptor from
| |
| isSystemSchema | back to summary |
|---|---|
| private boolean isSystemSchema(String schema) Return true if the schema is a system schema.
| |
| main | back to summary |
|---|---|
| public static void main(String[] args) | |
| makeReadableSignature | back to summary |
|---|---|
| private String makeReadableSignature(SignatureChecker. Make a human readable signature for a routine. This can be used in error messages.
| |
| matchFunctions | back to summary |
|---|---|
| private void matchFunctions(Connection conn) throws SQLException Match the signatures of functions in this database.
| |
| matchProcedures | back to summary |
|---|---|
| private void matchProcedures(Connection conn) throws SQLException Match the signatures of procedures in this database.
| |
| matchSignatures | back to summary |
|---|---|
| private void matchSignatures(Connection conn) throws SQLException Match the signatures of routines in the database attached to this connection.
| |
| prepareStatement | back to summary |
|---|---|
| private PreparedStatement prepareStatement(Connection conn, String text) throws SQLException | |
| println | back to summary |
|---|---|
| private static void println(String text) | |
| printThrowable | back to summary |
|---|---|
private static void printThrowable(Throwable t)
| |
| printUsage | back to summary |
|---|---|
| private static void printUsage() | |
| putFunction | back to summary |
|---|---|
| private void putFunction(String schema, String name, boolean isTableFunction) Store a function descriptor. Updates | |
| putProcedure | back to summary |
|---|---|
| private void putProcedure(String schema, String name) Store a procedure descriptor. Updates | |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public boolean | |
| private void |
| _isValid | back to summary |
|---|---|
| private boolean _isValid | |
| _j2seConnectionUrl | back to summary |
|---|---|
| private String _j2seConnectionUrl | |
| ParsedArgs | back to summary |
|---|---|
| public ParsedArgs(String[] args) | |
| getJ2seConnectionUrl | back to summary |
|---|---|
| public String getJ2seConnectionUrl() | |
| isValid | back to summary |
|---|---|
| public boolean isValid() | |
| parseArgs | back to summary |
|---|---|
| private void parseArgs(String[] args) | |
| Modifier and Type | Field and Description |
|---|---|
| private final ArrayList | |
| private final boolean | |
| private final String | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private String | |
| public int | |
| public String | |
| public String | |
| public String | |
| public String | |
| public boolean | |
| public String |
| _argList | back to summary |
|---|---|
| private final ArrayList<String> _argList | |
| _isTableFunction | back to summary |
|---|---|
| private final boolean _isTableFunction | |
| _name | back to summary |
|---|---|
| private final String _name | |
| _schema | back to summary |
|---|---|
| private final String _schema | |
| SQLRoutine | back to summary |
|---|---|
| public SQLRoutine(String schema, String name, boolean isTableFunction) | |
| addArg | back to summary |
|---|---|
| public void addArg(String typeName) | |
| doubleQuote | back to summary |
|---|---|
| private String doubleQuote(String raw) | |
| getArgCount | back to summary |
|---|---|
| public int getArgCount() | |
| getArgType | back to summary |
|---|---|
| public String getArgType(int idx) | |
| getName | back to summary |
|---|---|
| public String getName() | |
| getQualifiedName | back to summary |
|---|---|
| public String getQualifiedName() | |
| getSchema | back to summary |
|---|---|
| public String getSchema() | |
| isTableFunction | back to summary |
|---|---|
| public boolean isTableFunction() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |