Slick can't connect to mssql database












1














I would like to use Slick (3.2.3) to connect to a MSSQL database.



Currently, my project is the following.



In application.conf, I have



somedbname = {
driver = "slick.jdbc.SQLServerProfile$"
db {
host = "somehost"
port = "someport"
databaseName = "Recupel.Datawarehouse"
url = "jdbc:sqlserver://"${somedbname.db.host}":"${somedbname.db.port}";databaseName="${somedbname.db.databaseName}";"
user = "someuser"
password = "somepassword"
}
}


The "somehost" looks like XX.X.XX.XX where X's are numbers.



My build.sbt contains



name := "test-slick"

version := "0.1"

scalaVersion in ThisBuild := "2.12.7"

libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % "3.2.3",
"com.typesafe.slick" %% "slick-hikaricp" % "3.2.3",
"org.slf4j" % "slf4j-nop" % "1.6.4",
"com.microsoft.sqlserver" % "mssql-jdbc" % "7.0.0.jre10"
)


The file with the "main" object contains



import slick.basic.DatabaseConfig
import slick.jdbc.JdbcProfile
import slick.jdbc.SQLServerProfile.api._

import scala.concurrent.Await
import scala.concurrent.duration._


val dbConfig: DatabaseConfig[JdbcProfile] = DatabaseConfig.forConfig("somedbname")

val db: JdbcProfile#Backend#Database = dbConfig.db

def main(args: Array[String]): Unit = {
try {

val future = db.run(sql"SELECT * FROM somettable".as[(Int, String, String, String, String,
String, String, String, String, String, String, String)])

println(Await.result(future, 10.seconds))

} finally {
db.close()
}


}

}


This, according to all the documentation that I could find, should be enough to connect to the database. However, when I run this, I get



[error] (run-main-0) java.sql.SQLTransientConnectionException: somedbname.db - Connection is not available, request timed out after 1004ms.
[error] java.sql.SQLTransientConnectionException: somedbname.db - Connection is not available, request timed out after 1004ms.
[error] at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:548)
[error] at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:186)
[error] at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:145)
[error] at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:83)
[error] at slick.jdbc.hikaricp.HikariCPJdbcDataSource.createConnection(HikariCPJdbcDataSource.scala:14)
[error] at slick.jdbc.JdbcBackend$BaseSession.<init>(JdbcBackend.scala:453)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:46)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:37)
[error] at slick.basic.BasicBackend$DatabaseDef.acquireSession(BasicBackend.scala:249)
[error] at slick.basic.BasicBackend$DatabaseDef.acquireSession$(BasicBackend.scala:248)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.acquireSession(JdbcBackend.scala:37)
[error] at slick.basic.BasicBackend$DatabaseDef$$anon$2.run(BasicBackend.scala:274)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error] at java.base/java.lang.Thread.run(Thread.java:844)
[error] Nonzero exit code: 1


Perhaps related and also annoying, when I run this code for the second (and subsequent) times, I get the following error instead:



Failed to get driver instance for jdbcUrl=jdbc:sqlserver://[...]


which forces me to kill and reload sbt each time.



What am I doing wrong? Worth noting: I can connect to the database with the same credential from a software like valentina.










share|improve this question






















  • Which Java version are you running on?
    – Mark Rotteveel
    Nov 21 '18 at 14:55










  • @MarkRoottevel java 10.0.1. Probably not a good idea... Do you think that I should downgrade to java 8?
    – Antoine
    Nov 21 '18 at 15:02












  • The error itself means that Hikari can't get a connection, which either means the pool is exhausted or it can't create connections. Given you used the Java 10 driver, I had hoped it might have been something simple like using Java 8, but alas. Only other thing I can think of is something like the driver not being loaded automatically; you may need to specify it explicitly in the config or load it yourself first. Given I don't know slick, nor Scala, I'm not sure how or where though.
    – Mark Rotteveel
    Nov 21 '18 at 15:04












  • @MarkRotteveel thanks for the suggestion, I'll try to look into explicitly specifying the driver.
    – Antoine
    Nov 21 '18 at 19:23
















1














I would like to use Slick (3.2.3) to connect to a MSSQL database.



Currently, my project is the following.



In application.conf, I have



somedbname = {
driver = "slick.jdbc.SQLServerProfile$"
db {
host = "somehost"
port = "someport"
databaseName = "Recupel.Datawarehouse"
url = "jdbc:sqlserver://"${somedbname.db.host}":"${somedbname.db.port}";databaseName="${somedbname.db.databaseName}";"
user = "someuser"
password = "somepassword"
}
}


The "somehost" looks like XX.X.XX.XX where X's are numbers.



My build.sbt contains



name := "test-slick"

version := "0.1"

scalaVersion in ThisBuild := "2.12.7"

libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % "3.2.3",
"com.typesafe.slick" %% "slick-hikaricp" % "3.2.3",
"org.slf4j" % "slf4j-nop" % "1.6.4",
"com.microsoft.sqlserver" % "mssql-jdbc" % "7.0.0.jre10"
)


The file with the "main" object contains



import slick.basic.DatabaseConfig
import slick.jdbc.JdbcProfile
import slick.jdbc.SQLServerProfile.api._

import scala.concurrent.Await
import scala.concurrent.duration._


val dbConfig: DatabaseConfig[JdbcProfile] = DatabaseConfig.forConfig("somedbname")

val db: JdbcProfile#Backend#Database = dbConfig.db

def main(args: Array[String]): Unit = {
try {

val future = db.run(sql"SELECT * FROM somettable".as[(Int, String, String, String, String,
String, String, String, String, String, String, String)])

println(Await.result(future, 10.seconds))

} finally {
db.close()
}


}

}


This, according to all the documentation that I could find, should be enough to connect to the database. However, when I run this, I get



[error] (run-main-0) java.sql.SQLTransientConnectionException: somedbname.db - Connection is not available, request timed out after 1004ms.
[error] java.sql.SQLTransientConnectionException: somedbname.db - Connection is not available, request timed out after 1004ms.
[error] at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:548)
[error] at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:186)
[error] at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:145)
[error] at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:83)
[error] at slick.jdbc.hikaricp.HikariCPJdbcDataSource.createConnection(HikariCPJdbcDataSource.scala:14)
[error] at slick.jdbc.JdbcBackend$BaseSession.<init>(JdbcBackend.scala:453)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:46)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:37)
[error] at slick.basic.BasicBackend$DatabaseDef.acquireSession(BasicBackend.scala:249)
[error] at slick.basic.BasicBackend$DatabaseDef.acquireSession$(BasicBackend.scala:248)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.acquireSession(JdbcBackend.scala:37)
[error] at slick.basic.BasicBackend$DatabaseDef$$anon$2.run(BasicBackend.scala:274)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error] at java.base/java.lang.Thread.run(Thread.java:844)
[error] Nonzero exit code: 1


Perhaps related and also annoying, when I run this code for the second (and subsequent) times, I get the following error instead:



Failed to get driver instance for jdbcUrl=jdbc:sqlserver://[...]


which forces me to kill and reload sbt each time.



What am I doing wrong? Worth noting: I can connect to the database with the same credential from a software like valentina.










share|improve this question






















  • Which Java version are you running on?
    – Mark Rotteveel
    Nov 21 '18 at 14:55










  • @MarkRoottevel java 10.0.1. Probably not a good idea... Do you think that I should downgrade to java 8?
    – Antoine
    Nov 21 '18 at 15:02












  • The error itself means that Hikari can't get a connection, which either means the pool is exhausted or it can't create connections. Given you used the Java 10 driver, I had hoped it might have been something simple like using Java 8, but alas. Only other thing I can think of is something like the driver not being loaded automatically; you may need to specify it explicitly in the config or load it yourself first. Given I don't know slick, nor Scala, I'm not sure how or where though.
    – Mark Rotteveel
    Nov 21 '18 at 15:04












  • @MarkRotteveel thanks for the suggestion, I'll try to look into explicitly specifying the driver.
    – Antoine
    Nov 21 '18 at 19:23














1












1








1







I would like to use Slick (3.2.3) to connect to a MSSQL database.



Currently, my project is the following.



In application.conf, I have



somedbname = {
driver = "slick.jdbc.SQLServerProfile$"
db {
host = "somehost"
port = "someport"
databaseName = "Recupel.Datawarehouse"
url = "jdbc:sqlserver://"${somedbname.db.host}":"${somedbname.db.port}";databaseName="${somedbname.db.databaseName}";"
user = "someuser"
password = "somepassword"
}
}


The "somehost" looks like XX.X.XX.XX where X's are numbers.



My build.sbt contains



name := "test-slick"

version := "0.1"

scalaVersion in ThisBuild := "2.12.7"

libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % "3.2.3",
"com.typesafe.slick" %% "slick-hikaricp" % "3.2.3",
"org.slf4j" % "slf4j-nop" % "1.6.4",
"com.microsoft.sqlserver" % "mssql-jdbc" % "7.0.0.jre10"
)


The file with the "main" object contains



import slick.basic.DatabaseConfig
import slick.jdbc.JdbcProfile
import slick.jdbc.SQLServerProfile.api._

import scala.concurrent.Await
import scala.concurrent.duration._


val dbConfig: DatabaseConfig[JdbcProfile] = DatabaseConfig.forConfig("somedbname")

val db: JdbcProfile#Backend#Database = dbConfig.db

def main(args: Array[String]): Unit = {
try {

val future = db.run(sql"SELECT * FROM somettable".as[(Int, String, String, String, String,
String, String, String, String, String, String, String)])

println(Await.result(future, 10.seconds))

} finally {
db.close()
}


}

}


This, according to all the documentation that I could find, should be enough to connect to the database. However, when I run this, I get



[error] (run-main-0) java.sql.SQLTransientConnectionException: somedbname.db - Connection is not available, request timed out after 1004ms.
[error] java.sql.SQLTransientConnectionException: somedbname.db - Connection is not available, request timed out after 1004ms.
[error] at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:548)
[error] at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:186)
[error] at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:145)
[error] at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:83)
[error] at slick.jdbc.hikaricp.HikariCPJdbcDataSource.createConnection(HikariCPJdbcDataSource.scala:14)
[error] at slick.jdbc.JdbcBackend$BaseSession.<init>(JdbcBackend.scala:453)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:46)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:37)
[error] at slick.basic.BasicBackend$DatabaseDef.acquireSession(BasicBackend.scala:249)
[error] at slick.basic.BasicBackend$DatabaseDef.acquireSession$(BasicBackend.scala:248)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.acquireSession(JdbcBackend.scala:37)
[error] at slick.basic.BasicBackend$DatabaseDef$$anon$2.run(BasicBackend.scala:274)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error] at java.base/java.lang.Thread.run(Thread.java:844)
[error] Nonzero exit code: 1


Perhaps related and also annoying, when I run this code for the second (and subsequent) times, I get the following error instead:



Failed to get driver instance for jdbcUrl=jdbc:sqlserver://[...]


which forces me to kill and reload sbt each time.



What am I doing wrong? Worth noting: I can connect to the database with the same credential from a software like valentina.










share|improve this question













I would like to use Slick (3.2.3) to connect to a MSSQL database.



Currently, my project is the following.



In application.conf, I have



somedbname = {
driver = "slick.jdbc.SQLServerProfile$"
db {
host = "somehost"
port = "someport"
databaseName = "Recupel.Datawarehouse"
url = "jdbc:sqlserver://"${somedbname.db.host}":"${somedbname.db.port}";databaseName="${somedbname.db.databaseName}";"
user = "someuser"
password = "somepassword"
}
}


The "somehost" looks like XX.X.XX.XX where X's are numbers.



My build.sbt contains



name := "test-slick"

version := "0.1"

scalaVersion in ThisBuild := "2.12.7"

libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % "3.2.3",
"com.typesafe.slick" %% "slick-hikaricp" % "3.2.3",
"org.slf4j" % "slf4j-nop" % "1.6.4",
"com.microsoft.sqlserver" % "mssql-jdbc" % "7.0.0.jre10"
)


The file with the "main" object contains



import slick.basic.DatabaseConfig
import slick.jdbc.JdbcProfile
import slick.jdbc.SQLServerProfile.api._

import scala.concurrent.Await
import scala.concurrent.duration._


val dbConfig: DatabaseConfig[JdbcProfile] = DatabaseConfig.forConfig("somedbname")

val db: JdbcProfile#Backend#Database = dbConfig.db

def main(args: Array[String]): Unit = {
try {

val future = db.run(sql"SELECT * FROM somettable".as[(Int, String, String, String, String,
String, String, String, String, String, String, String)])

println(Await.result(future, 10.seconds))

} finally {
db.close()
}


}

}


This, according to all the documentation that I could find, should be enough to connect to the database. However, when I run this, I get



[error] (run-main-0) java.sql.SQLTransientConnectionException: somedbname.db - Connection is not available, request timed out after 1004ms.
[error] java.sql.SQLTransientConnectionException: somedbname.db - Connection is not available, request timed out after 1004ms.
[error] at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:548)
[error] at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:186)
[error] at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:145)
[error] at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:83)
[error] at slick.jdbc.hikaricp.HikariCPJdbcDataSource.createConnection(HikariCPJdbcDataSource.scala:14)
[error] at slick.jdbc.JdbcBackend$BaseSession.<init>(JdbcBackend.scala:453)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:46)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:37)
[error] at slick.basic.BasicBackend$DatabaseDef.acquireSession(BasicBackend.scala:249)
[error] at slick.basic.BasicBackend$DatabaseDef.acquireSession$(BasicBackend.scala:248)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.acquireSession(JdbcBackend.scala:37)
[error] at slick.basic.BasicBackend$DatabaseDef$$anon$2.run(BasicBackend.scala:274)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error] at java.base/java.lang.Thread.run(Thread.java:844)
[error] Nonzero exit code: 1


Perhaps related and also annoying, when I run this code for the second (and subsequent) times, I get the following error instead:



Failed to get driver instance for jdbcUrl=jdbc:sqlserver://[...]


which forces me to kill and reload sbt each time.



What am I doing wrong? Worth noting: I can connect to the database with the same credential from a software like valentina.







sql-server scala jdbc slick






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 13:34









Antoine

215




215












  • Which Java version are you running on?
    – Mark Rotteveel
    Nov 21 '18 at 14:55










  • @MarkRoottevel java 10.0.1. Probably not a good idea... Do you think that I should downgrade to java 8?
    – Antoine
    Nov 21 '18 at 15:02












  • The error itself means that Hikari can't get a connection, which either means the pool is exhausted or it can't create connections. Given you used the Java 10 driver, I had hoped it might have been something simple like using Java 8, but alas. Only other thing I can think of is something like the driver not being loaded automatically; you may need to specify it explicitly in the config or load it yourself first. Given I don't know slick, nor Scala, I'm not sure how or where though.
    – Mark Rotteveel
    Nov 21 '18 at 15:04












  • @MarkRotteveel thanks for the suggestion, I'll try to look into explicitly specifying the driver.
    – Antoine
    Nov 21 '18 at 19:23


















  • Which Java version are you running on?
    – Mark Rotteveel
    Nov 21 '18 at 14:55










  • @MarkRoottevel java 10.0.1. Probably not a good idea... Do you think that I should downgrade to java 8?
    – Antoine
    Nov 21 '18 at 15:02












  • The error itself means that Hikari can't get a connection, which either means the pool is exhausted or it can't create connections. Given you used the Java 10 driver, I had hoped it might have been something simple like using Java 8, but alas. Only other thing I can think of is something like the driver not being loaded automatically; you may need to specify it explicitly in the config or load it yourself first. Given I don't know slick, nor Scala, I'm not sure how or where though.
    – Mark Rotteveel
    Nov 21 '18 at 15:04












  • @MarkRotteveel thanks for the suggestion, I'll try to look into explicitly specifying the driver.
    – Antoine
    Nov 21 '18 at 19:23
















Which Java version are you running on?
– Mark Rotteveel
Nov 21 '18 at 14:55




Which Java version are you running on?
– Mark Rotteveel
Nov 21 '18 at 14:55












@MarkRoottevel java 10.0.1. Probably not a good idea... Do you think that I should downgrade to java 8?
– Antoine
Nov 21 '18 at 15:02






@MarkRoottevel java 10.0.1. Probably not a good idea... Do you think that I should downgrade to java 8?
– Antoine
Nov 21 '18 at 15:02














The error itself means that Hikari can't get a connection, which either means the pool is exhausted or it can't create connections. Given you used the Java 10 driver, I had hoped it might have been something simple like using Java 8, but alas. Only other thing I can think of is something like the driver not being loaded automatically; you may need to specify it explicitly in the config or load it yourself first. Given I don't know slick, nor Scala, I'm not sure how or where though.
– Mark Rotteveel
Nov 21 '18 at 15:04






The error itself means that Hikari can't get a connection, which either means the pool is exhausted or it can't create connections. Given you used the Java 10 driver, I had hoped it might have been something simple like using Java 8, but alas. Only other thing I can think of is something like the driver not being loaded automatically; you may need to specify it explicitly in the config or load it yourself first. Given I don't know slick, nor Scala, I'm not sure how or where though.
– Mark Rotteveel
Nov 21 '18 at 15:04














@MarkRotteveel thanks for the suggestion, I'll try to look into explicitly specifying the driver.
– Antoine
Nov 21 '18 at 19:23




@MarkRotteveel thanks for the suggestion, I'll try to look into explicitly specifying the driver.
– Antoine
Nov 21 '18 at 19:23












1 Answer
1






active

oldest

votes


















1














As suggested by @MarkRotteveel, and following this link, I found a solution.



First, I explicitly set the driver, adding the line



driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"


in the db dictionary, after password = "somepassword".



Secondly, the default timeout (after one second) appears to be too short for my purposes, and therefore I added the line
connectionTimeout = "30 seconds"
after the previous driver line, still in the db dictionary.



Now it works.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53413231%2fslick-cant-connect-to-mssql-database%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    As suggested by @MarkRotteveel, and following this link, I found a solution.



    First, I explicitly set the driver, adding the line



    driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"


    in the db dictionary, after password = "somepassword".



    Secondly, the default timeout (after one second) appears to be too short for my purposes, and therefore I added the line
    connectionTimeout = "30 seconds"
    after the previous driver line, still in the db dictionary.



    Now it works.






    share|improve this answer


























      1














      As suggested by @MarkRotteveel, and following this link, I found a solution.



      First, I explicitly set the driver, adding the line



      driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"


      in the db dictionary, after password = "somepassword".



      Secondly, the default timeout (after one second) appears to be too short for my purposes, and therefore I added the line
      connectionTimeout = "30 seconds"
      after the previous driver line, still in the db dictionary.



      Now it works.






      share|improve this answer
























        1












        1








        1






        As suggested by @MarkRotteveel, and following this link, I found a solution.



        First, I explicitly set the driver, adding the line



        driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"


        in the db dictionary, after password = "somepassword".



        Secondly, the default timeout (after one second) appears to be too short for my purposes, and therefore I added the line
        connectionTimeout = "30 seconds"
        after the previous driver line, still in the db dictionary.



        Now it works.






        share|improve this answer












        As suggested by @MarkRotteveel, and following this link, I found a solution.



        First, I explicitly set the driver, adding the line



        driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"


        in the db dictionary, after password = "somepassword".



        Secondly, the default timeout (after one second) appears to be too short for my purposes, and therefore I added the line
        connectionTimeout = "30 seconds"
        after the previous driver line, still in the db dictionary.



        Now it works.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 21 '18 at 20:20









        Antoine

        215




        215






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53413231%2fslick-cant-connect-to-mssql-database%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            TypeError: fit_transform() missing 1 required positional argument: 'X'