Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8801741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:54:44+00:00 2026-06-14T00:54:44+00:00

This is weird, I am connecting to a sql server 2008 instance that has

  • 0

This is weird, I am connecting to a sql server 2008 instance that has integrated authentication configured for windows. I found a way to bypass integrated authentication it by doing this in code:

Connection con = DriverManager.getConnection( "jdbc:jtds:sqlserver://mydbserver/myDbname;useNTLMv2=true;username=$jboss;password=1234;domain=MYDOMAIN", "$jboss", "1234");

So that above after doing the class for name on the jtds drivers it works perfect. However, I need to put this as a connection string in a config file and when I change the above to use the method call on getConnection without explicity sending in the username,password params like this:

 Connection con = DriverManager.getConnection( "jdbc:jtds:sqlserver://mydbserver/myDbname;useNTLMv2=true;username=$jboss;password=1234;domain=MYDOMAIN");

I get a Native SSPI library not loaded exception because its trying to authenticate using windows authentication. So I find the dll in the jts distribution add ntlmauth.dll to my bin and system classpath and then I get an untrusted domain login exception which I know I can resolve by doing “RUNAS.exe ” under the domain but that gets me back to having to use integrated authentication which I don’t want.

The question comes down to, why can I create a Connection without any issues by passing in the username and password as params on the getConnection() method but when I don’t it forces integrated authentication. This would not be an issue if I created the Connection myself in code but I need a single connection string to put in my properties file and don’t know how to construct a connection string that will call getConnection() and supply the username,password as params.

I hate these tedious issues have Googled but have come up empty handed, any input would help. – Duncan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:54:45+00:00Added an answer on June 14, 2026 at 12:54 am

    The parameter is user, not username. That should fix your issues. So try:

     Connection con = DriverManager.getConnection( "jdbc:jtds:sqlserver://mydbserver/myDbname;useNTLMv2=true;user=$jboss;password=1234;domain=MYDOMAIN");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just found out this weird behavior, is this a bug or what am
I've written some code that runs an MDX query against an SQL Server Analysis
I have a server hosting a website of mine that has almost zero-traffic. A
This is a weird one. I have a local server on which I develop
I have this weird problem where whenever I #include SDL/SDL.h , my windows socket
I have this really weird problem with git on Windows 7. I've installed msysgit,
I'm facing a weird production problem. Environment is the following: JBOSS 4.0.2 SQL Server
So I have few ASP.NET apps all running off SQL Server Express 2008 and
this weird thing is happening with my uitableview cell selection style, Instead of changing
Getting this weird LINQ error. title = System.Linq.Enumerable+WhereSelectEnumerableIterator`2[System.Xml.Linq.XElement,System.String Here is the code I have:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.