How to connect to MS SQL Server

2,204 views
Skip to first unread message

Adis

unread,
Feb 16, 2011, 4:39:33 PM2/16/11
to play-framework
Hi All,

I have spend several hours trying to connect to my local mssql server
(MSSQL 2008 R2) but no succes.

In my application.conf:

db.url=jdbc:sqlserver://localhost:1433
db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
jpa.dialect=org.hibernate.dialect.SQLServerDialect
db.user=myUser
db.pass=myPass01

and I placed the sqljdbc4.jar in my projects lib folder

but i get the error message:

A database error occured : Cannot connected to the database, No
suitable driver found for jdbc

Please help or advise how to solve this one.
Thanks all!

McKinley1411

unread,
Feb 17, 2011, 2:35:39 AM2/17/11
to play-framework
Your driver and connection strings are correct. Did you restart play
after placing sqljdbc4.jar in lib?

jTDS works well too. http://jtds.sourceforge.net/

Example:

db.driver=net.sourceforge.jtds.jdbc.Driver
db.url=jdbc:jtds:sqlserver://127.0.0.1:1433/mydb;appName=PlayDEV;

Cheers,

McKinley

Adis

unread,
Feb 17, 2011, 3:51:12 AM2/17/11
to play-framework
Hi McKinley,

thanks for your answer! Indeed, I did not restart play after placing
the jar file.
This morning it finally worked :-)

Solution was the restart!

On 17 feb, 08:35, McKinley1411 <mckinley1...@gmail.com> wrote:
> Your driver and connection strings are correct. Did you restart play
> after placing sqljdbc4.jar in lib?
>
> jTDS works well too.http://jtds.sourceforge.net/
Message has been deleted

Arsen Anay

unread,
Apr 23, 2016, 2:07:13 AM4/23/16
to play-framework
Hello Mr. Mc Kinley. From where can I know the appName?
Reply all
Reply to author
Forward
0 new messages