Issues connecting to sql server using slick extensions

269 views
Skip to first unread message

Preethi Dasa

unread,
Nov 11, 2015, 10:51:32 PM11/11/15
to Slick / ScalaQuery
Hi,

I am running a Windows VM with sql server ( with port forwarding). I am having trouble connecting to the db.
These are the dependencies:

"com.typesafe.slick" %% "slick" "3.1.0",
"com.typesafe.slick" %% "slick-hikaricp" "3.1.0",
"com.typesafe.slick" %% "slick-extensions" % "3.1.0",
"net.sourceforge.jtds" % "jtds" % "1.3.1",


And this is the code:

import com.typesafe.slick.driver.ms.SQLServerDriver.api._ 

import slick.jdbc.meta.MTable

import scala.concurrent.Await 

import scala.concurrent.duration._ 


val db = Database.forURL("jdbc:sqlserver://localhost:1433;databaseName=mydb;encrypt=false;trustServerCertificate=true;",driver="com.typesafe.slick.driver.ms.SQLServerDriver") 

val f = Await.result(db.run(MTable.getTables), 1.second) 


Gives this error: 

slick.SlickException: Driver com.typesafe.slick.driver.ms.SQLServerDriver does not know how to handle URL jdbc:sqlserver://localhost:1433;databaseName=mydb;encrypt=false;trustServerCertificate=true; 

  at slick.jdbc.DriverDataSource$$anonfun$init$2$$anonfun$apply$3.apply(DriverDataSource.scala:67) 

  at slick.jdbc.DriverDataSource$$anonfun$init$2$$anonfun$apply$3.apply(DriverDataSource.scala:62) 

Caused by: java.sql.SQLException: No suitable driver 


Can anybody give me some leads? Any help is appreciated.

Thanks,
Preethi 

wolfgan...@hotmail.com

unread,
Mar 15, 2016, 4:42:16 AM3/15/16
to Slick / ScalaQuery
I run into the same issue! Could you solve the problem?

Ruslans Tarasovs

unread,
Mar 17, 2016, 6:08:58 AM3/17/16
to Slick / ScalaQuery
As a minimum the one need to replace "jdbc:sqlserver" by "jdbc:jtds" if the one uses jTDS as a driver.

See the following for more details:
Reply all
Reply to author
Forward
0 new messages