DB2Connection.ClientUser property
Gets or sets the client user ID.
- Namespace:
IBM.Data.DB2- Assembly:
IBM.Data.DB2(in IBM.Data.DB2.dll)
Syntax
[Visual Basic]
Public Property ClientUser As String
[C#]
public string ClientUser {get; set;}
[C++]
public: __property String* get_ClientUser();
public: __property void set_ClientUser(String*);
[JScript]
public function get ClientUser() : String;
public function set ClientUser(String);
Property value
The IBM Data Server Provider for .NET has limit of 255 characters for the ClientUser property.
- Db2 for z/OS Version 11 servers in new function mode (NFM) support a length of up to 128 characters for the CURRENT CLIENT_USERID special register.
- Db2 for z/OS Version 10 and earlier servers support a length of up to 16 characters.
- Db2 for z/OS servers remove trailing spaces that are specified in the ClientUser property value.
- Db2 for IBM i V6R1 and later servers support a length of up to 255 characters.
The default value of the ClientUser property is an empty string ("").
The ClientUser property value in the DB2Connection class is stored in the Db2® special register (CURRENT CLIENT_USERID).
The ClientUser property must be set before the start of a transaction. Changes to the ClientUser property after the start of a transaction do not take effect until the start of the next transaction.
The Db2 for z/OS server sets the CURRENT CLIENT_USERID special register value by default when it is not explicitly set by the Db2 client. The default CURRENT CLIENT_USERID special register value that is set by the Db2 for z/OS server is the user ID that is specified for a connection. The ClientUser property can return the default value only when the enableDefaultClientInfo keyword is set to True in the IBM® data server driver configuration file.
- You have not explicitly set the client user ID (accounting user ID) registry value.
- The enableDefaultClientInfo IBM data server driver configuration keyword is set to True.