I am new to Play framework. I have problem in connection of sql server from play 2.4.6.
File application.conf
as bellow
db.default.url="jdbc:jtds:sqlserver://127.0.0.1:1433/DBNAME",
db.default.driver=net.sourceforge.jtds.jdbc.Driver,
db.default.user=sa,
db.default.pass=pass
I added jtds-1.2.6 jar
in the lib
and libexec
folders.
build.sbt file as below.
libraryDependencies ++= Seq(
javaJdbc,
"net.sourceforge.jtds" % "jtds" % "1.2.6",
cache,
javaWs
)
fork in run := true
But when i go to browser at http://localhost:9000/ i get following error
Cannot connect to database [default]
please help me any one.
Following is detailed Exception:
! @700ahko28 - Internal server error, for (GET) [/] -> application -
play.api.Configuration$$anon$1: Configuration error[Cannot connect to database [default]] at play.api.Configuration$.configError(Configuration.scala:154) at play.api.Configuration.reportError(Configuration.scala:806) at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:48) at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:42) at scala.collection.immutable.List.foreach(List.scala:381) at play.api.db.DefaultDBApi.connect(DefaultDBApi.scala:42) at play.api.db.DBApiProvider.get$lzycompute(DBModule.scala:72) at play.api.db.DBApiProvider.get(DBModule.scala:62) at play.api.db.DBApiProvider.get(DBModule.scala:58) at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81) Caused by: play.api.Configuration$$anon$1: Configuration error[Exception during pool initialization: HikariPool-0 - Connection is not available, request timed out after 30001ms.]