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:

  1. enable tcp/ip connection in sql configuration manager.

  2. open sql server management studio (if not have installed, install it; can have its own pitfalls, however).

  3. right-click on database server (as in picture below) , click in properties. right-clicking on database server

  4. select security option , mark sql server , windows authentication mode. click in ok. database server security properties
  5. open sql server configuration manager , restart sql server service.

after this, got connections without problems. this article helped me lot.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -