Procedures
You can use the DatabaseMetaData interface to retrieve stored procedure information. The getProcedures method returns descriptions of the available stored procedures.
The following code retrieves the names of the available stored procedures:
String connectionString = "jdbc:dynamics365:InitiateOAuth=GETANDREFRESH;OrganizationUrl=https://myaccount.operations.dynamics.com/;Edition=Sales;"; Connection conn = DriverManager.getConnection(connectionString); DatabaseMetaData meta = conn.getMetaData(); ResultSet rs = meta.getProcedures(null, null, "%"); while(rs.next()){ System.out.println(rs.getString("PROCEDURE_NAME")); }The getProcedures method returns the following columns:
Column Name | Data Type | Description |
PROCEDURE_CAT | String | The catalog the procedure belongs to. |
PROCEDURE_SCHEM | String | The schema the procedure belongs to. |
PROCEDURE_NAME | String | The stored procedure name. |
REMARKS | String | The description of the stored procedure. |
PROCEDURE_TYPE | short | Returns 2 if the procedure returns a result. Returns 1 if the procedure does not return a result. Returns 0 if unknown. |
SPECIFIC_NAME | String | The name that uniquely identifies the stored procedure within its schema. |