Tried
DatabaseMetaData md = con.getMetaData();
Connection rc = md.getConnection();
but that just returns the same ConnectionHandle object. Looks like I'm at a dead end because for two different connections I get instances of the same classes loaded by two different classloaders, which makes them completely incompatible. Sigh...