This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JDBC and the fly likes Setting client ID to anonymous connection for auditing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Setting client ID to anonymous connection for auditing" Watch "Setting client ID to anonymous connection for auditing" New topic
Author

Setting client ID to anonymous connection for auditing

Brian Mulholland
Ranch Hand

Joined: Mar 12, 2009
Posts: 61
So, I've been on projects where this was done in the past so i know it's possible, but it was always somebody else who did it. I am setting up a type 4 connection to our DB2 back end and we establish connection anonymously through the pooler. We use WAS 6. How does one set the 'client ID' that database triggers can then capture to know what user to set to the audit tables?

I have a code sample that worked in a test somebody left behind:



But that produces:

java.lang.ClassCastException: com/ibm/db2/jcc/a/nc incompatible with com/ibm/websphere/rsadapter/WSConnection

I *think* I am connecting with a type 4 driver (see my other thread where I ask how to know for sure) and this activity is supposed to be implemented on a type 4, but obviously something is wrong somewhere.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Brian Mulholland wrote:
java.lang.ClassCastException: com/ibm/db2/jcc/a/nc incompatible with com/ibm/websphere/rsadapter/WSConnection

Where you get this exception, on which line?


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
 
GeeCON Prague 2014
 
subject: Setting client ID to anonymous connection for auditing