File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting client ID to anonymous connection for auditing
 
Similar Threads
what are JMX Configuration required in WebSphere5.0 with JDK1.4/Sample Pmirm.xml
glassfish to JBoss communication through RMI
Trouble to get simple web service registration code running
how to connect db2 with java application
Auditing for Oracle with EclipseLink JPA