Tutorial: Stored Procedures
This is an example of the components ProcedureDataSet and ProcedureProvider.
The UI has a DDL tab, which reads SQL statements from the sql files in the
project i.e. sqlInterbase.sql is the file containing all the definitions of
tables and procedures needed for this example. To clean up afterward, press
the toggle button (at the bottom of the DDL page) and run again.
The actual example is the "Test Procedures" page. This represent another
version of a master detail relationship, where the top grid is data from a
Query on a DEPARTMENT table, and the bottom grid is data from a Procedure call,
that delivers data from a EMPLOYEE table.
The Procedure uses the DEPTID field from the current row of the Query to
determine the current detail set. After moving the cursor in the Query grid,
the refresh button for the bottom grid must be pressed to get the employees
in that department.
The updates of the Query are handled by the default QueryResolver, and the
updates of the Procedure are handled by the ProcedureResolver.
Note: To modify the database connection edit the source of StoredProcedureDM.
There is a section of outcommented code for other connections and procedure
definitions, for Interbase, Oracle, Sybase. Remember to modify the dbSample.jpr
project file to include the classpath for the drivers on your machine.