Connection from DevTest to MS SQL Server fails to connect to the database
search cancel

Connection from DevTest to MS SQL Server fails to connect to the database

book

Article ID: 272772

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

After configuring IAM to connect to a SQL Server database (with a named instance) in the iam.properties file and starting services, server.log shows the following error:

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host <DB_Servername>\Instance, port <port number> has failed. Verify the connection properties.

Error during startup: java.lang.RuntimeException: Failed to connect to the database

Environment

Release : 10.7.2

SQL Server named instance 

Cause

backslashes are being used as an escape by the application

Resolution

Edit the iam.properties and use 3 backslashes between the Server name and the instance name.

For IAM:

iam.db.url=jdbc:sqlserver://DBServername\\\InstanceName:1433;databaseName=<iam db>

ie:

iam.db.url=jdbc:sqlserver://DBSERVER1\\\MSSQLSRVR:1433;databaseName=iamdb


For Enterprise Dashboard:

dradis.db.url=jdbc:sqlserver://DBServername\\\InstanceName:1433;databaseName=<ED db>


For Registry:

lisadb.pool.common.url=jdbc:sqlserver://DBServername\\\InstanceName:1433;databaseName=<Registry db>

Additional Information

Configure DevTest to Use SQL Server

Configuring DEVTEST to use an External SQL Server Database (also with integratedSecurity)