Archive for November, 2006

IP Address Locator Update

I’ve done a little more work on the IP address locator project.  I’ve added a CountryHelper class that looks up a country name based on a two character country code in order to completely fill out the LocationPOJO object in getLocation.  I changed the query that looks up the IP address info in the database so that it performs much faster.  It’s still not as fast as it could be though.  If I leave out the “and end_ip_num > ?” clause it performs much much faster but also returns bad results if the IP number is greater than 2^32.  As I typed that I came up with the fix.  I need to check the incoming IP number to see if it is greater than 2^32 before performing the query.  If I can eliminate the check on the high end in the query it will become much faster and also correct for all values between 0 and 2^32.  That fix will have to wait for the morning however.

Here is the project EAR file as it stands now.  As usual any questions and comments are welcome.