I am writing a Java Application in which I am connecting to a DB2 database and after getting the connection, I am setting the client info for that connection using the following code:
String clientprogname = "MY PROGRAM"; //Progname
String clientname = "user1"; // The name of the End-User
con.setClientInfo("ApplicationName", clientprogname);
con.setClientInfo("ClientUser", clientname);
con.prepareStatement("SELECT * FROM SYSIBM.SYSDUMMY1 WHERE 0 = 1").executeQuery();
// Execute SQL to force extended client information to be sent to the server
LogFile.log("ApplicationName: " + con.getClientInfo("ApplicationName"));
LogFile.log("ClientUser: " + con.getClientInfo("ClientUser"));
I am aware that I can get the client info using con.getClientInfo, but is the client information stored in the database? According to the Java Documentation, the client information is stored in a suitable location in the database (for example in a special register, session parameter, or system table column). Is there an SQL statement which I can execute to see a list of all open connection?
According to this you can get it from the special registers, here’s an older topic that references the same thing.
Edited:
This is also a nice link that lists a number of useful statements dbForums