Cannot connect MSSQL

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot connect MSSQL

Don Barton
Well, it is solved!
Thank you for all your suggestions.  The actual answer was quite convoluted.
There is a dll that needed to be loaded in the Java bin directory that
allows for Windows Single Sign on (SSO).
The file is ntlmauth.dll.  This file comes with the jtds-1.3.1-dist from
SourceForge.

Regardless if  your OS is 64 bit or not, you need to use the version of
ntlmauth.dll that corresponds to your Java (32 or 64 bit) version.
So if you're running a 64 bit Windows, but Java is 32 bit, then you need
copy the ntlmauth.dll in the x86 folder to the Java bin under
C:\Program(x86)\Java\jreXX.XX\bin

Then remember not to use a username and password when logging on.  This
worked for a networked server at work, as well as a local server on my
computer at home.

Solved. It was well worth it for the query building capabilities in the
Squirrel if for nothing else!

It is interesting that two other clients; HeidiSQL, and DBeaver, didn't have
this problem at all and allowed me to connect immediately (hint, hinit??)

Don
------------------------------

Message: 3
Date: Tue, 10 May 2016 12:12:11 +0100
From: Neville Rowe <[hidden email]>
Subject: Re: [Squirrel-sql-users] Cannot connect MSSQL
To: Don Barton <[hidden email]>
Cc: [hidden email]
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="us-ascii"

Hi Don,
A quick check - have you got the driver loaded? I don't use the JTDS driver
but I just up that URL into Squirrel here and got that error.
Neville




------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Reply | Threaded
Open this post in threaded view
|

Re: Cannot connect MSSQL

Neville Rowe
Hmmm.

So HeidiSQL is written in Delphi / Object Pascal and uses a custom DB connection layer - not jdbc therefore going to be a different set of problems.

DBeaver on the other hand is java based and uses jdbc. On installation when I first start to create a jtds connection to MS SQL, DBeaver comes up with a screen 'missing files, you can download them automatically' which includes the ntlmauth.dll. It seems to use Maven to sort that out. The dll is then installed in a dbeaver/metadata folder in the users home directory. Also DBeaver distributes and uses a specific JRE rather than the one installed in the system by default - which presumably means they can have more flexibility.

I'll think about what we could do with this.... At the very least a sensible error message should be possible but maybe we could do something cleverer. I'm sure that DLL doesn't have to be in the JRE directory, we should be able to tell the JVM where to find it.

Neville

> From: [hidden email]

> To: [hidden email]
> Date: Wed, 11 May 2016 20:40:10 -0600
> Subject: [Squirrel-sql-users] Cannot connect MSSQL
>
> Well, it is solved!
> Thank you for all your suggestions. The actual answer was quite convoluted.
> There is a dll that needed to be loaded in the Java bin directory that
> allows for Windows Single Sign on (SSO).
> The file is ntlmauth.dll. This file comes with the jtds-1.3.1-dist from
> SourceForge.
>
> Regardless if your OS is 64 bit or not, you need to use the version of
> ntlmauth.dll that corresponds to your Java (32 or 64 bit) version.
> So if you're running a 64 bit Windows, but Java is 32 bit, then you need
> copy the ntlmauth.dll in the x86 folder to the Java bin under
> C:\Program(x86)\Java\jreXX.XX\bin
>
> Then remember not to use a username and password when logging on. This
> worked for a networked server at work, as well as a local server on my
> computer at home.
>
> Solved. It was well worth it for the query building capabilities in the
> Squirrel if for nothing else!
>
> It is interesting that two other clients; HeidiSQL, and DBeaver, didn't have
> this problem at all and allowed me to connect immediately (hint, hinit??)
>
> Don
> ------------------------------
>
> Message: 3
> Date: Tue, 10 May 2016 12:12:11 +0100
> From: Neville Rowe <[hidden email]>
> Subject: Re: [Squirrel-sql-users] Cannot connect MSSQL
> To: Don Barton <[hidden email]>
> Cc: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi Don,
> A quick check - have you got the driver loaded? I don't use the JTDS driver
> but I just up that URL into Squirrel here and got that error.
> Neville
>
>
>
>
> ------------------------------------------------------------------------------
> Mobile security can be enabling, not merely restricting. Employees who
> bring their own devices (BYOD) to work are irked by the imposition of MDM
> restrictions. Mobile Device Manager Plus allows you to control only the
> apps on BYO-devices by containerizing them, leaving personal data untouched!
> https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
> _______________________________________________
> Squirrel-sql-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Reply | Threaded
Open this post in threaded view
|

Re: Cannot connect MSSQL

John Hardin
In reply to this post by Don Barton
On Wed, 11 May 2016, Don Barton wrote:

> There is a dll that needed to be loaded in the Java bin directory that
> allows for Windows Single Sign on (SSO).
> The file is ntlmauth.dll.  This file comes with the jtds-1.3.1-dist from
> SourceForge.

...or use SQL Server logins. :)

I assume there's some reason you (or your DBA) are unwilling to enable
mixed-mode auth.


--
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  [hidden email]    FALaholic #11174     pgpk -a [hidden email]
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
  142 days since the first successful real return to launch site (SpaceX)

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users