Forum Discussion

Vighnesh's avatar
Vighnesh
New Contributor
8 years ago

How to connect to Microsoft SQL server 2014 local DB from Open source soap UI version?

Hello,

 

I'm trying to connect to Microsoft sql server 2014 local Db from Soap UI open version, However it's not working.

Below are the details :-

SQL server 2014 Express Local DB

ServerName - (localdb)\mssqllocaldb

Instance Name - LOCALDB#DCD9BDD9 

Credentials - Windows Authentication

 

I'm using below Driver and Connection String in Soap UI JDBC step. 

Driver - com.microsoft.sqlserver.jdbc.SQLServerDriver

Connection String - jdbc:sqlserver://(localdb)\mssqllocaldb\LOCALDB#DCD9BDD9;databaseName=test;integratedSecurity=true

 

I'm getting below error

 

Can't get the Connection for specified properties; com.microsoft.sqlserver.jdbc.SQLServerException: The connection to the host (localdb)mssqllocaldb, named instance localdb#dcd9bdd9 failed. Error: "java.net.UnknownHostException: (localdb)mssqllocaldb". Verify the server and instance names and check that no firewall is blocking UDP traffic to port 1434. For SQL Server 2005 or later, verify that the SQL Server Browser Service is running on the host.

 

Could you please help me out what's going wrong with my connection string or with driver? 

6 Replies

  • Julio's avatar
    Julio
    Occasional Contributor
    Spoiler
     

    I suspect it is the instance name - can you use the server name and the port instead.  That worked for me.i.e.

     

     

    The web (https://msdn.microsoft.com/en-us/library/ms378428(v=sql.110).aspx) recommended:
    jdbc:sqlserver://SERVERNAME;instanceName=INSTANCENAME;databaseName=DB;user=test;password=PASS_VALUE

     
    But use

    use jdbc:sqlserver://SERVERNAME:PORT;databaseName=DB;user=test;password=PASS_VALUE

     

    i.e. your instance should be using a port other than the default 1433.

    • Vighnesh's avatar
      Vighnesh
      New Contributor

      Hi Julio,

       

      Thanks for your reply.

       

      However my server name is = "(localdb)\mssqllocaldb" and as its Microsoft sql server 2014 local db its not running on any port. Please correct me if I'm wrong. Right now I'm not able to find out my local db port number on which it is running so, I taken another way which is of instance name.

       

      Could you please give me clear idea how I can create my connection string using my server name , instance name and windows authentication?

       

      I tried with the port number 1433 and even with other port numbers it giving me below exception - 

       

      Can't get the Connection for specified properties; com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host mssqllocaldb, port 1434 has failed. Error: "null. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

       

      I checked the TCP/IP connection all the things are working fine however still I'm not able to connect to my database.