Last updated on
Apr 27, 2021
Issue
A "Connection verification failed for data source" error may occur while attempting to verify a SQL Server data source that connects to SQL Server Express using the default ColdFusion SQL Server JDBC driver.
The full error is as follows:
Connection verification failed for data source: {data source name} java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused: connect The root cause was that: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver] Error establishing socket. Connection refused: connect
Reason
The TCP/IP and Named Pipes protocols are disabled by default upon the installation of SQL Server Express.
The default TCP/IP port that SQL Server Express listens on may not be 1433.
Solution
To configure a data source for SQL Server Express using the default SQL Server driver, follow these steps:
-
Launch the SQL Server Configuration Manager.
-
Expand "Server Network Configuration".
-
Expand Protocols for "SQLEXPRESS".
-
Enable Named Pipes.
-
Enable TCP.
-
Select TCP/IP in the right pane.
-
Select Properties > IP Addresses.
-
Make "Enabled" for all applicable IPs = "Yes".
-
Note the TCP port value or add if one does not exist for all applicable IPs.
-
Restart SQL Express.
-
Configure a SQL Server JDBC data source in the ColdFusion Administrator to listen on the port number from step 9 above.
-
Complete the data source configuration connectivity and authentication information.
-
Saving the data source should verify without error