An application uses a connection factory to create a connection.
IBM.XMS.IPropertyContext | +----IBM.XMS.IConnectionFactory
For a list of the XMS defined properties of a ConnectionFactory object, see Properties of ConnectionFactory.
Method | Description |
---|---|
CreateConnection | Create a connection factory with the default properties. |
CreateConnection | Create a connection using a specified user identity. |
IConnection CreateConnection();
Create a connection factory with the default properties.
The connection factory properties XMSC_USERID and XMSC_PASSWORD, if they are set, are used to authenticate the application. If these properties are not set, the connection is created without authenticating the application, provided the messaging server permits a connection without authentication. The properties are ignored if the application connects to a WebSphere MQ queue manager in bindings mode.
IConnection CreateConnection(String userId, String password);
Create a connection using a specified user identity.
The specified user identifier and password are used to authenticate the application. The connection factory properties XMSC_USERID and XMSC_PASSWORD, if they are set, are ignored. The user identifier and password are ignored if the application connects to a WebSphere MQ queue manager in bindings mode.
The connection is created in stopped mode. No messages are delivered until the application calls Connection.start().