java - Trying to connect to SQL Server 2008 Express database with SQL Server authentication always result in "Login failed for user '...'." -
i using jtds connect liferay instance sql server 2008 express server using sql server authentication (instead of windows' auth method). have in portal-ext.properties
:
jdbc.default.driverclassname=net.sourceforge.jtds.jdbc.driver jdbc.default.url=jdbc:jtds:sqlserver://127.0.0.1:1433/somedb jdbc.default.username=someuser jdbc.default.password=somepassword
(for not know liferay, alike call
class.forname("net.sourceforge.jtds.jdbc.driver"); con = drivermanager.getconnection("jdbc:jtds:sqlserver://127.0.0.1:1433/somedb", "someuser", "somepassword");
however, although pass correct username , password, keeps going wrong message login failed user 'someuser'
. dead sure server login, database user , database exists , configured.
what can wrong?
well, suppose there can infinite reasons such error. in case, nonetheless, solution following:
enable tcp/ip connection in sql configuration manager.
open sql server management studio (if not have installed, install it; can have its own pitfalls, however).
right-click on database server (as in picture below) , click in
properties
.- select
security
option , marksql server , windows authentication mode
. click in ok. - open sql server configuration manager , restart sql server service.
after this, got connections without problems. this article helped me lot.
Comments
Post a Comment