public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern)
      throws SQLException {

    String sql =
        "SELECT ROUTINE_SCHEMA PROCEDURE_CAT,NULL PROCEDURE_SCHEM, ROUTINE_NAME PROCEDURE_NAME,"
            + " NULL RESERVED1, NULL RESERVED2, NULL RESERVED3,"
            + " CASE ROUTINE_TYPE "
            + "  WHEN 'FUNCTION' THEN " + procedureReturnsResult
            + "  WHEN 'PROCEDURE' THEN " + procedureNoResult
            + "  ELSE " + procedureResultUnknown
            + " END PROCEDURE_TYPE,"
            + " ROUTINE_COMMENT REMARKS, SPECIFIC_NAME "
            + " FROM INFORMATION_SCHEMA.ROUTINES "
            + " WHERE "
            + catalogCond("ROUTINE_SCHEMA", catalog)
            + " AND "
            + patternCond("ROUTINE_NAME", procedureNamePattern)
            + "/* AND ROUTINE_TYPE='PROCEDURE' */";
    return executeQuery(sql);
  }
public ResultSet getProcedures ( String catalog , String schemaPattern , String procedureNamePattern ) throws SQLException { String sql = "SELECT ROUTINE_SCHEMA PROCEDURE_CAT,NULL PROCEDURE_SCHEM, ROUTINE_NAME PROCEDURE_NAME," + " NULL RESERVED1, NULL RESERVED2, NULL RESERVED3," + " CASE ROUTINE_TYPE " + "  WHEN 'FUNCTION' THEN " + procedureReturnsResult + "  WHEN 'PROCEDURE' THEN " + procedureNoResult + "  ELSE " + procedureResultUnknown + " END PROCEDURE_TYPE," + " ROUTINE_COMMENT REMARKS, SPECIFIC_NAME " + " FROM INFORMATION_SCHEMA.ROUTINES " + " WHERE " + catalogCond ( "ROUTINE_SCHEMA" , catalog ) + " AND " + patternCond ( "ROUTINE_NAME" , procedureNamePattern ) + "/* AND ROUTINE_TYPE='PROCEDURE' */" ; return executeQuery ( sql ) ; }
Retrieves a description of the stored procedures available in the given catalog. Only procedure
descriptions matching the schema and procedure name criteria are returned.  They are ordered
by
<code>PROCEDURE_CAT</code>,
<code>PROCEDURE_SCHEM</code>, <code>PROCEDURE_NAME</code> and <code>SPECIFIC_ NAME</code>.

<P>Each procedure description has the the following columns:</p>

<OL> <LI><B>PROCEDURE_CAT</B>
String {@code =>} procedure catalog (may be
<code>null</code>) <LI><B>PROCEDURE_SCHEM</B> String {@code =>} procedure schema (may be
<code>null</code>) <LI><B>PROCEDURE_NAME</B> String
{@code =>} procedure name <LI> reserved for future use <LI> reserved for future use <LI>
reserved for future use <LI><B>REMARKS</B> String {@code =>} explanatory comment on the
procedure <LI><B>PROCEDURE_TYPE</B> short {@code =>} kind of procedure: <UL> <LI>
procedureResultUnknown - Cannot determine if  a return value will be returned <LI>
procedureNoResult - Does not return a return value <LI> procedureReturnsResult - Returns a
return value </UL> <LI><B>SPECIFIC_NAME</B> String  {@code =>} The name which uniquely
identifies this procedure within its schema.
</OL>
A user may not have permissions to execute any of the procedures that are returned by
<code>getProcedures</code>

@param catalog              a catalog name; must match the catalog name as it is stored in the
database; "" retrieves those without a catalog;
<code>null</code> means that the catalog name should not be used
to narrow the search
@param schemaPattern        a schema name pattern; must match the schema name as it is stored
in the database; "" retrieves those without a schema;
<code>null</code> means that the schema name should not be used to
narrow the search
@param procedureNamePattern a procedure name pattern; must match the procedure name as it is
stored in the database
@return <code>ResultSet</code> - each row is a procedure description
@throws SQLException if a database access error occurs
@see #getSearchStringEscape