Udostępnij za pośrednictwem


IConnection.SetClientInfo(String, String) Method

Definition

Sets the value of the client info property specified by name to the value specified by value.

[Android.Runtime.Register("setClientInfo", "(Ljava/lang/String;Ljava/lang/String;)V", "GetSetClientInfo_Ljava_lang_String_Ljava_lang_String_Handler:Java.Sql.IConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void SetClientInfo (string? name, string? value);
[<Android.Runtime.Register("setClientInfo", "(Ljava/lang/String;Ljava/lang/String;)V", "GetSetClientInfo_Ljava_lang_String_Ljava_lang_String_Handler:Java.Sql.IConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member SetClientInfo : string * string -> unit

Parameters

name
String

The name of the client info property to set

value
String

The value to set the client info property to. If the value is null, the current value of the specified property is cleared. <p>

Attributes

Exceptions

if this connection is closed, or there's a problem setting the property.

Remarks

Sets the value of the client info property specified by name to the value specified by value.

Applications may use the DatabaseMetaData.getClientInfoProperties method to determine the client info properties supported by the driver and the maximum length that may be specified for each property.

The driver stores the value specified in a suitable location in the database. For example in a special register, session parameter, or system table column. For efficiency the driver may defer setting the value in the database until the next time a statement is executed or prepared. Other than storing the client information in the appropriate place in the database, these methods shall not alter the behavior of the connection in anyway. The values supplied to these methods are used for accounting, diagnostics and debugging purposes only.

The driver shall generate a warning if the client info name specified is not recognized by the driver.

If the value specified to this method is greater than the maximum length for the property the driver may either truncate the value and generate a warning or generate a SQLClientInfoException. If the driver generates a SQLClientInfoException, the value specified was not set on the connection.

The following are standard client info properties. Drivers are not required to support these properties however if the driver supports a client info property that can be described by one of the standard properties, the standard property name should be used.

<ul> <li>ApplicationName - The name of the application currently utilizing the connection</li> <li>ClientUser - The name of the user that the application using the connection is performing work for. This may not be the same as the user name that was used in establishing the connection.</li> <li>ClientHostname - The hostname of the computer the application using the connection is running on.</li> </ul>

Added in 1.6.

Java documentation for java.sql.Connection.setClientInfo(java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to