Create an Object to Connect to a Node
The name of the Connect:Direct® node and the connection information is set at object creation time using the CDNode constructor. If a parameter is not supplied (NULL pointer), the default value for that parameter is read from the Registry. During construction, the CDNode object attempts to connect to the physical Connect:Direct node using the protocol information contained in the Registry. If the connection fails, the CDConnectionException is returned. If the connection is successful but the logon is denied by the server, a CDLogonException is returned.
The CDNode object creates and removes the connection to the Connect:Direct node as needed. Connections are shared and reused as different requests are made. The following section of the class definition displays the methods to construct a CDNode object and methods to retrieve node information:
|
The following two examples illustrate two different methods for creating a CDNode object. The first method creates the CDNode object locally on the stack. The second example creates a dynamic allocation of a CDNode object from the stack. Both methods then execute a SELECT PROCESS command using the CDNode object.
|