Posts tagged "sql"

Identifying the correct MS-SQL JDBC port for the LiveCycle data source

Recently I was helping a customer with their LiveCycle installation and we could not get the “Test Database Connection” on the LiveCycle Configuration Manager’s (LCM) DataSource Configuration screen to work.  The customer was positive that they were using the default port (1433) but we always got the following error message:

Error [ALC-LCM-130-107]
Database settings failed validation.  Note: Windows Authentication on
SQL Server will fail the connection test.  See documentation for more details.

I confirmed they were using the correct driver and that they had the SQL Server configured for mixed mode authentication (not Windows Authentication).  What threw us off the most was that they were able to run a simple Java application that successfully connected to the same database from the LC server using the same driver and connection properties with one difference.  We noticed that the connection string in the Java app did not have a port defined.  So if a port is not defined it must mean it is using the default port of 1433 right?  Wrong!

It turns out that as of SQL Server 2005, Microsoft introduced something called the “SQL Server Browser” service which essentially listens for incoming requests to the SQL Server.  With this service running, requests without a defined port are automatically connected to the correct server instance.  Therefore, a connection string on the client side that has no port defined can still connect to the appropriate database as long as the correct host is defined and regardless of which port the database is configured to listen on.  The following links provide more information about the SQL Server Browser service:

http://msdn.microsoft.com/en-us/library/ms165724(v=sql.90).aspx
http://www.mssqltips.com/sqlservertip/1946/overview-of-the-sql-server-br
owser-service/ 

Once we determined what the actual port was (not 1433), the LCM data source test connection was successful.  The following article provides various ways to determine the actual listening port used by a SQL Server database instance:

http://decipherinfosys.wordpress.com/2008/01/02/finding-the-port-number-for-a-particular-sql-server-instance/