PL/SQL to Java conversion