Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring application using MSSQL 2000 datasource (Mixed mode authentication)

 
Sankara Dhakshinamurthy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

A spring based application is running on "SERVER A" and tries to connect to a MS SQL 2000 database instance on "SERVER B". The SQL server running on "SERVER B" is set to allow mixed mode authentication (SQL as well as Windows Authentication).

When connecting using SQL authentication I get the following

"java.sql.SQLException: Login failed for user 'MYUSERNAME'. Reason: Not associated with a trusted SQL Server connection."

I researched a bit and found the cause to be associated with NTLM support. Since both the servers are windows based I thought i'll connect using Windows Authentication. I downloaded the required file (ntlmauth.dll) and placed it in the appropriate path. If I don't specify the username and password in the database connection properties jTDS assumes the authentication type to be Windows based (Please correct me if I am wrong).

Now when the application connects I get the following exception

"org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.)"

It doesn't seem to be getting the associated windows username. How do I enable support for NTLM in Tomcat 6? Is there anything that I am missing?

applicationContext.xml


database properties


It would be really great if someone could shed some light on this.

P.S : The application connects perfectly to a database on the same server. We started having this problem since moving the database to a different server (SERVER B).

Thanks,
Shanks

 
abani patra
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have faced some time ago one issue like that , I fixed that by putting user name and password in single quote in properties file .
You can try that.
 
Sankara Dhakshinamurthy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi abani patra,

Thanks for replying.

I tried what you mentioned but unfortunately it didn't solve the issue.

Regards,
S
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic