Preloading a Java library in DB2, similar to ORACLE's loadjava
Ok, what I believe you are after is creating Java routines (ie, stored procedures implemented in Java and stored within DB2).

You will want to follow the documentation in this section on Java routines. Pay special attention to the Creating, Building, and Deploying sections.

And even though this is an older article, you may wish to check out this article "Solve common problems with DB2 UDB Java stored procedures" on developerworks. It also discusses the when/where of using Java routines in DB2, how you go about creating them, and common problems encountered.