An application uses a connection factory to create a connection.
xms::PropertyContext | +----xms::ConnectionFactory
For a list of the XMS defined properties of a ConnectionFactory object, see Properties of ConnectionFactory.
Constructor | Description |
---|---|
ConnectionFactory | Create a connection factory with the default properties. |
Method | Description |
---|---|
~ConnectionFactory | Delete the connection factory. |
createConnection | Create a connection using the default user identity. |
createConnection | Create a connection using a specified user identity. |
getHandle | Get the handle that a C application would use to access the connection factory. |
isNull | Determine whether the ConnectionFactory object is a null object. |
Connection createConnection();
Create a connection using the default user identity.
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.
The connection is created in stopped mode. No messages are delivered until the application calls Connection.start().
Connection createConnection(const String & userID, const 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().