Derby provides referential actions. Examples in this section are included to illustrate how to write triggers.
You can choose to use standard SQL referential integrity (using foreign keys) to obtain this functionality, rather than writing triggers. See the "CONSTRAINT clause" topic in the Derby Reference Manual for details.