I have never used DB2, but a little googling led me to this page:
specialRegisters=special-register-name=special-register-value,…special-register-name=special-register-value
A list of special register settings for the JDBC connection. You can
specify one or more special register name and value pairs. Special
register name and value pairs must be delimited by commas (,). The
last pair must end with a semicolon (;). For example:
String url =
"jdbc:db2://sysmvs1.stl.ibm.com:5021/STLEC1" +
":user=dbadm;password=dbadm;" +
"specialRegisters=CURRENT_PATH=SYSIBM,CURRENT CLIENT_USERID=test" + ";";
Connection con =
java.sql.DriverManager.getConnection(url);
For special registers that can be set through IBM Data Server Driver
for JDBC and SQLJ Connection properties, if you set a special register
value in a URL string using specialRegisters, and you also set that
value in a java.util.Properties object using the following form of
getConnection, the special register is set to the value from the URL
string.
As SESSION_USER is a special register, this seems to imply you need to specify it with your connection properties as
specialRegisters=SESSION_USER=otheruser;
Either in the JDBC url, or in the properties.
However as I have never used DB2, I don't know if this is the actual solution.