Adriano (Firebird Core Team member) published a document (sorry, only in Portuguese) describing how he developed the integration between Java and Firebird, allowing people to write procedures and triggers in Java.