• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Spring application using MSSQL 2000 datasource (Mixed mode authentication)

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Replace the word "snake" with "danger noodle" in all tiny ads.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic