Am trying to use MSSQL server with Play Framework, In my application.conf
db.url=jdbc:microsoft:sqlserver://localhost\SQL2008:1433;DatabaseName=testDB
db.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
db.user=sa
db.pass=sa
Am getting this below error
Database error
A database error occured : Cannot connected to the database, [Microsoft][SQLServer
2000 Driver for JDBC]Error establishing socket.
play.exceptions.DatabaseException: Cannot connected to the database, [Microsoft]
[SQLServer 2000 Driver for JDBC]Error establishing socket.
at play.db.DBPlugin.onApplicationStart(DBPlugin.java:132)
at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:425)
at play.Play.start(Play.java:495)
at play.Play.detectChanges(Play.java:599)
at play.Invoker$Invocation.init(Invoker.java:186)
at Invocation.HTTP Request(Play!)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error
establishing socket.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
I have added sqljdbc4.jar to lib folder.
even tried using mssqlserver.jar,msutil.jar,msbase.jar
May be useful for someone,looking for MSSQL along with play.
First download jtds
copy jtds jar file to
as well as your application lib folder
restart play
In your application.conf
Start Playing 🙂
Update For Play2
Add play dependencies to your
Build.scalalike thisThere is change in
conffile in Play2…restart play
SBTwill download dependencies for you. Start Playing 🙂