In the NetBeans IDE, open the .java file containing the message-driven bean you just created.
From the palette, under JCA, drag TCPIP onto the code canvas as shown in the far right of the following illustration:
In the JCA Wizard, provide appropriate values for the TCP/IP JCA Adapter declaration and then click Finish
Result:Three blocks of sample code are added, as shown (expanded) below.
Expand each block and edit the code as needed for your implementation.