I have a local MS SQL Server Express 2016 running on 1433. I can connect to it via MS SQL Management Studio and HeidiSQL just fine.
In Eclipse Neon I created a new JPA project. I want to create entities from my DB. So I click on JPA Tools -> Generate Entities from Tables...
. In the following dialog window I click on the Add connections...
icon. By searching the internet I found two different approaches for continuing from here:
a) Connection Profile Type: SQL Server
b) Connection Profile Type: Generic JDBC
a) In the following window I add a new driver, specify the path to my sqljdbc42.jar
and set all the properties (Driver Class: com.microsoft.sqlserver.jdbc.SQLServerDriver
). The weird thing, when I chose this driver, in the Properties
section nothing shows up and I get the following error:
b) Similar to a) I add a new driver, specify the path to the jar file and set all the properties. This time I get one step further: I can press the Test Connection
button. If I do so however, the window freezes for a few seconds and then shows a Ping failed!
error.
I guess the URL is wrong so I tried a lot of different variations but none of them worked. Here are a few of them (but I tried many more):
jdbc:sqlserver://MyPcName\SQLEXPRESS:1433 jdbc:sqlserver://MyPcName\SQLEXPRESS jdbc:sqlserver://MyPcName\SQLEXPRESS:1433 jdbc:sqlserver://MyPcName\SQLEXPRESS jdbc:sqlserver://localhost:1433 jdbc:sqlserver://MyPcName\SQLEXPRESS:1433;DatabaseName=MyDb
As mentioned above, connecting via Management Studio or HeidiSQL works (with the username test
and no password). And while it should not matter since the server is running locally I tried turning of the firewall and it did not help either.