How to connect to MS SQL Server Express in JetBrains DataGrip 1.0?

I am trying to configure a new tool from JetBrains : DataGrip to work with a local installation of MS SQL Server 2014 Express . I spent some time trying to "convert" the ms connection string to jdbc, but no luck. I can connect using MS SQL Server 2014 management Studio .

So here is my connection string:

 "Data Source=MyPCName\MySQLInstanceName;Initial Catalog=MyDataBaseNameA3D;Integrated Security=True;" 

My best guess was based on the msdn example:

 jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value]] 

MSDN: Connect to SQL Server using the JDBC driver. Create connection url

 jdbc:sqlserver://MyPCName\MySQLInstanceName:1433;databaseName=MyDataBaseNameA3D;integratedSecurity=true; 

Has anyone resolved such a problem and maybe can get me through the setup steps?

Otherwise, I just throw this tool away. I have spent enough time on what should be very simplified.

+6
source share
1 answer

DataGrip has predefined jdbc url patterns for each jdbc driver. For MS SQL Server, it has two drivers:

  • SQL Server (Microsoft driver) with a pattern URL string: jdbc:sqlserver://host:port;databaseName=<your db name>

  • SQL Server (jTDS driver) with a pattern URL string: jdbc:jtds:sqlserver://host:port/<your db name>

In both cases, the database name is optional. This url template is also populated automatically if you specify the appropriate connection parameters. Since DataGrip 2016 termination is also possible when filling in the connection settings: Configure DB Connection

Your URL may be correct, but you are getting tcp connection errors. In this case, make sure that if you connect through the TCP port, SQL Server is configured to accept remote connections to the specified IP address and listen on tcp connections on the specified port number (or see SQL Server Documentation ).

If you are connecting through a named instance , make sure to specify the instance name in the connection settings and omit the port indication (if this is the "express" version of Sql Server, the instance name may be SQLEXPRESS ).

UPD: see also Connecting DataGrip to MS SQL Server on the DataGrip blog.

+10
source

All Articles