Methods invoked within an application are called application-side methods. Methods invoked within Derby are called database-side routines.
An application-side method can be exactly the same as a database-side routine. The only difference is where you invoke them. You write the method only once. Where you invoke the method--within the application or within an SQL statement--determines whether it is an "application-side" or a "database-side" method.