This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Unable to connect to SQL server using JTDS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Unable to connect to SQL server using JTDS" Watch "Unable to connect to SQL server using JTDS" New topic
Author

Unable to connect to SQL server using JTDS

Ananth Chellathurai
Ranch Hand

Joined: Nov 21, 2007
Posts: 349

Hi Ranchers,

I am struggling to connect to SQLServer using jtds-1.2. I am able to connect to the server using Enterprise Manager, but when I tried through my application it throws exceptions. This is how I try,


This is my exception



Any help could be appreciated.

Ananth Chellathurai


Ananth Chellathurai [Walk on software]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9915
    
158

java.sql.SQLException: Login failed for user 'ananth_chellathurai'.


Are you sure, you are passing the correct password? Where does the username and password come from, in your code?
[ September 04, 2008: Message edited by: Jaikiran Pai ]

[My Blog] [JavaRanch Journal]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9915
    
158

I'll move this to our JDBC forum, where you might get more response.
Ananth Chellathurai
Ranch Hand

Joined: Nov 21, 2007
Posts: 349

The user name and password are same while I try to access it through jtds and enterprise manager. User name is ananth_chellathurai is my windows user name. I am sure I am providing the right password too.

Ananth Chellathurai
Ananth Chellathurai
Ranch Hand

Joined: Nov 21, 2007
Posts: 349

I tried to connect using a database user name and I have succeeded to get a connection. But the problem is when I tried using my windows user id and password.

Any guess on what I miss here?

Ananth Chellathurai
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

If you are using NTLM, have you tried including the domain (see the jTDS FAQs for more about connection oprions)?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
Don't get me started about those stupid light bulbs.
 
subject: Unable to connect to SQL server using JTDS
 
Similar Threads
FormUtils.getFormValues
using jdbc thin driver of oracle 10XE
SQL Error suring server startup
Apache POI, FormFile, and XSSF
connection, pool exhausted ???