Testing Connectivity with Ilogin

Once you have set up all of the sqlhosts, hosts, and services information, the final step is to try to actually connect up to that machine. Informix provides a program called "ilogin," which will attempt to log into a remote system and provide some information that is included in the demo "stores" database. Running ilogin brings up the following screen (resized smaller for this book):



The ilogin program was actually a demo program for one of the earlier versions of ESQL/C for Windows. If you can find an earlier version (around 7.1 - 7.2) with ESQL/C installed, you can view the source code. Reading through this source code is a good exercise if you want to see how Informix handles setting communications variables internally.

When you choose the "File" menu from ilogin, you get the following screen:



If you do not fill any of the blanks and just hit the "OK" button, ilogin will try to access the server that you have specified as "default" in setnet. It tries to read a customer table from the stores 7 demonstration database. This database is not installed automatically during Informix installs and is quite often not installed on production machines. You can change the "Stores Database" to a database that is on the machine if you wish. If the stores database is not installed on the target server, hitting OK in ilogin gives you the following error screen:



This is a case in which getting an error message indicates success. Ilogin was able to log onto the default system and did not find stores7, so it told you so. This means that the connectivity is established and verified from your client to your target server.

If you do have the "stores7" database installed on your server, you will get a screen like the following:



This is also a success, since ilogin was able to log onto the target server and extract information. I mentioned earlier that sometimes it is a challenge to verify exactly which Informix server you are talking to, especially in environments where you have multiple servers and multiple hosts. There's a little trick that I use that makes it simpler. If you have stores7 installed, go into the database and delete all of the rows from the customer table. Then enter one row that has the name of the server that holds the database as the "lname" or "fname" variable. Since this is the data pulled back in ilogin, when you connect you'll get a screen that looks like this:



You now have proof positive that you are connected to the system you think you are connected to. You can also accomplish a similar task by entering the name of another unique database in the "Stores Database" edit box on the ilogin Run screen. It will go out to the chosen database and display an empty customer screen, thus showing that you have connected to a machine that contains the proper database name.

If you wish to test connectivity to other systems that are in the sqlhosts file (or registry) but are not the default database, you can enter the Server Name, Host Name, and other sqlhosts information directly into the ilogin Run screen. These systems must be available either in setnet or sqlhosts. Just entering the names in ilogin does not create the sqlhosts information. Being able to enter the parameters manually can be a useful tool for debugging Informix connectivity, as you can try overriding the sqlhosts information. For example, you could enter "1526" instead of "turbo." If it worked with "1526" but not with "turbo," you would look at your services file to see why the translation is not working correctly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset