Does DB2 have equivalents for Oracle's UTL_ENCODE and UTL_RAW modules?
I believe you are correct. It does not look like DB2 has built in support for base64 encoding.

So that would leave the following as options:


Handle the encoding within your programs.
Write a Java routine (stored procedure) to handle it.
Using a different encryption scheme. DB2 comes with encryption built into itself. There is an ENCRYPT function. Check it out.


Be careful with Java implementations of base64 though. A coworker of mine has mentioned he has seen a bug in all versions of it, in which "words" that have duplicate letters can decrypt into junk. So be careful and double check your base64 encoding/decoding.