user1514409
user1514409

Reputation: 41

Play framework 2.0.2 SQL Server config

I have problem connect to SQL Server :

In my application.conf I have:

db.default.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
db.default.url="jdbc:sqlserver://localhost\\SQLEXPRESS:1433;databaseName=testdb;user=sa;password=***;" 

When I run the app I get an error:

play.api.Configuration$$anon$1: Configuration error
[Driver not found: [com.microsoft.sqlserver.jdbc.SQLServerDriver]]

pl help me

Upvotes: 4

Views: 2443

Answers (2)

Răzvan Flavius Panda
Răzvan Flavius Panda

Reputation: 22106

You need to download the official MS SQL Server drivers https://www.microsoft.com/en-us/download/details.aspx?id=11774

And then copy the driver jar sqljdbc4.jar to the lib folder under project root (as Adam mentioned before).

Upvotes: 0

Adam Rabung
Adam Rabung

Reputation: 5224

You need the Sql Server drivers in your classpath. You can do that by creating a lib/ directory and placing the SQL Server driver jar in there, or updating your SBT dependencies. See http://www.playframework.org/documentation/2.0.2/SBTDependencies

Upvotes: 3

Related Questions