aspose file tools*
The moose likes JDBC and the fly likes Spring application using MSSQL 2000 datasource (Mixed mode authentication) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Spring application using MSSQL 2000 datasource (Mixed mode authentication)" Watch "Spring application using MSSQL 2000 datasource (Mixed mode authentication)" New topic
Author

Spring application using MSSQL 2000 datasource (Mixed mode authentication)

Sankara Dhakshinamurthy
Greenhorn

Joined: Jun 23, 2010
Posts: 2
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

Joined: Oct 11, 2011
Posts: 70
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

Joined: Jun 23, 2010
Posts: 2
Hi abani patra,

Thanks for replying.

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

Regards,
S
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring application using MSSQL 2000 datasource (Mixed mode authentication)
 
Similar Threads
how can i configure spring with hibernate shard?
Spring Javamelody
java.sql.SQLException: No suitable driver
[SPRING] Using .properties File
JPA-hibernate-spring config