# MS SQL 2017 Driver and URL?

**URL:** <https://forum.servoy.com/t/ms-sql-2017-driver-and-url/19762>\
**Category:** Classic Servoy\
**Created:** [August 10, 2018, 5:57pm UTC](https://forum.servoy.com/t/ms-sql-2017-driver-and-url/19762 "2018-08-10T17:57:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcusick](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bcusick](https://forum.servoy.com/u/bcusick)\
**Post date:** [August 10, 2018, 5:57pm UTC](https://forum.servoy.com/t/ms-sql-2017-driver-and-url/19762/1 "2018-08-10T17:57:40Z")

</div>

Hey Guys,

Has anyone had any success in connecting to a SQL Server 2017 database?

I downloaded the 7.0 version of the Microsoft JDBC driver, and according to the MS Site the configuration URL is:

```auto
jdbc:microsoft:sqlserver://<server>:<port>;DatabaseName=<databaseName>

```

(Reference: [Connection URL sample - JDBC Driver for SQL Server | Microsoft Learn](https://docs.microsoft.com/en-us/sql/connect/jdbc/connection-url-sample?view=sql-server-2017))

The Driver is:

```auto
com.microsoft.sqlserver.jdbc.SQLServerDriver

```

When I try to connect to a valid database - I get this error:

```auto
Driver 'com.microsoft.sqlserver.jdbc.SQLServerDriver' does not accept url 'jdbc:microsoft:sqlserver://10.14.80.107:1433;DatabaseName=Servoy_PROD_Respository'

```

Anyone have any ideas?

Bob

Java: 1.8.0\_515\_b12  
Platform: Windows Server (NT 6.2)

---

<div class="post-metadata">

**Author:** ![kwpsd](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kwpsd](https://forum.servoy.com/u/kwpsd)\
**Post date:** [August 12, 2018, 8:55pm UTC](https://forum.servoy.com/t/ms-sql-2017-driver-and-url/19762/2 "2018-08-12T20:55:46Z")

</div>

Hi. Bob.

No experience with MSSQL 2017 andjdbc 7.0. However, here is what we use for MSSQL 2016 and jdbc 4.2, and it works:

```auto
jdbc:sqlserver://10.14.80.107:1433;DatabaseName=Servoy_PROD_Respository;SelectMethod=cursor

```

---

<div class="post-metadata">

**Author:** ![bcusick](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bcusick](https://forum.servoy.com/u/bcusick)\
**Post date:** [August 13, 2018, 4:30pm UTC](https://forum.servoy.com/t/ms-sql-2017-driver-and-url/19762/3 "2018-08-13T16:30:07Z")

</div>

Thanks, Kim!

Still unable to get it to work right - but it’s OK - I think I’ll have them downgrade the DB to 2014 or 2016…

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [August 14, 2018, 7:48am UTC](https://forum.servoy.com/t/ms-sql-2017-driver-and-url/19762/4 "2018-08-14T07:48:59Z")

</div>

I’m running a SQL Server 2017 and connect to it just fine.

Your URL is odd. Where did you get that from? If you just create a new database connection from within Servoy using the MS driver, you get this kind of URL (as stated in the docs you link to):

```auto
jdbc:sqlserver://localhost:1433;DatabaseName=<database_name>;SelectMethod=direct

```

Please note the SelectMethod=direct. In the past the default was “cursor”, but that is probably less efficient for a Servoy application.

Make sure you download the latest JDBC driver and remove potentially old drivers from Servoy’s driver dir. The latest driver should be available here:

[https://www.microsoft.com/en-us/downloa … x?id=57175](https://www.microsoft.com/en-us/download/details.aspx?id=57175)

I think getting the connection right is a way easier task than downgrading the DB…

---

<div class="post-metadata">

**Author:** ![marco.rossi](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@marco.rossi](https://forum.servoy.com/u/marco.rossi)\
**Post date:** [July 31, 2019, 2:27pm UTC](https://forum.servoy.com/t/ms-sql-2017-driver-and-url/19762/5 "2019-07-31T14:27:11Z")

</div>

Hi all,  
I’m facing a similar problem:

I have a machine where I installed MSSQL 2017, Servoy 2019 and JasperServer 7.

JasperServer works without problem with MSSQL but Servoy 2019 has troubles when I use the SmartClient (With NGClient and NGClient desktop it works fine).  
I have a solution that onLoad event executes some queries. The same solution with the same queries works properly on NGClient And NGClientDesktop but has troubles with SmartClient.

With SmartClient the problem is that databaseManager.getDatasetBySQL returns always an empty dataset.

The JDBC connections show the table list properly.

Any idea?

---

<div class="post-metadata">

**Author:** ![kwpsd](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kwpsd](https://forum.servoy.com/u/kwpsd)\
**Post date:** [July 31, 2019, 11:54pm UTC](https://forum.servoy.com/t/ms-sql-2017-driver-and-url/19762/6 "2019-07-31T23:54:10Z")

</div>

> Please note the SelectMethod=direct. In the past the default was “cursor”, but that is probably less efficient for a Servoy application.

@Patrick: Just re-read this thread (a year later) and caught your note regarding the ‘direct’ vs. ‘cursor’ settings. I do not recall seeing the note before but wanted to let you know we made the changeover. Belatedly…thanks for pointing this out.
