Discussion:
[Squirrel-sql-users] Cannot connect MSSQL
Don Barton
2016-05-10 02:19:09 UTC
Permalink
I am trying to connect to a MSSQL server at work (testing environment), but
not able to connect to my server with the Squirrel.
I have downloaded DBeaver, and HeidiSQL, both of which have no problem
connecting to the MSSQL server.

With the DBeaver, I am using:
jdbc:jtds:sqlserver://xx.xx.xx.xxx.:1433/TESTDB. HeidiSQL works as well
after just supplying the IP address.

But when I use this connection string with the Squirrel, I get:

java.util.concurrent.ExecutionException: java.lang.RuntimeException:
java.sql.SQLException: Unable to create connection. Check your URL.

So I am not sure why it would work with 2 other clients, but not with the
Squirrel. I really like this client, especially because of its SQL building
capabilities.
I've googled several times, each trying something a little different, but
not hitting on what I need to do to get Squirrel to work. I tried many
variant of the connection string as well, all to no avail.

Don
Matt Ferreira
2016-05-10 09:08:31 UTC
Permalink
In your ip example you have a trailing period
"jdbc:jtds:sqlserver://xx.xx.xx.xxx." Try removing that

Also Check the connection string against the driver you are using. When you are setting up the connection and choosing the driver, it gives you a year example. While this shouldn't change between clients, it very well might. I don't use the MsSql driver so i am unable to tell you what it should be.
Post by Don Barton
I am trying to connect to a MSSQL server at work (testing environment), but
not able to connect to my server with the Squirrel.
I have downloaded DBeaver, and HeidiSQL, both of which have no problem
connecting to the MSSQL server.
jdbc:jtds:sqlserver://xx.xx.xx.xxx.:1433/TESTDB. HeidiSQL works as well
after just supplying the IP address.
java.sql.SQLException: Unable to create connection. Check your URL.
So I am not sure why it would work with 2 other clients, but not with the
Squirrel. I really like this client, especially because of its SQL building
capabilities.
I've googled several times, each trying something a little different, but
not hitting on what I need to do to get Squirrel to work. I tried many
variant of the connection string as well, all to no avail.
Don
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Neville Rowe
2016-05-10 11:12:11 UTC
Permalink
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
Post by Don Barton
I am trying to connect to a MSSQL server at work (testing environment), but
not able to connect to my server with the Squirrel.
I have downloaded DBeaver, and HeidiSQL, both of which have no problem
connecting to the MSSQL server.
jdbc:jtds:sqlserver://xx.xx.xx.xxx.:1433/TESTDB. HeidiSQL works as well
after just supplying the IP address.
java.sql.SQLException: Unable to create connection. Check your URL.
So I am not sure why it would work with 2 other clients, but not with the
Squirrel. I really like this client, especially because of its SQL building
capabilities.
I've googled several times, each trying something a little different, but
not hitting on what I need to do to get Squirrel to work. I tried many
variant of the connection string as well, all to no avail.
Don
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Alex Malmyguine
2016-05-10 13:46:40 UTC
Permalink
The setup should be like this (I have 2 paths entered as I experimented with both JTDS and MS drivers and still have both installed).



[cid:***@01D1AAA0.C7F8B6B0]

And then you set up aliases using this syntax (different if using MS driver):



[cid:***@01D1AAA0.C7F8B6B0]





Alex



-----Original Message-----
From: Don Barton [mailto:***@gmail.com]
Sent: Monday, May 09, 2016 10:19 PM
To: squirrel-sql-***@lists.sourceforge.net
Subject: [Squirrel-sql-users] Cannot connect MSSQL



I am trying to connect to a MSSQL server at work (testing environment), but not able to connect to my server with the Squirrel.

I have downloaded DBeaver, and HeidiSQL, both of which have no problem connecting to the MSSQL server.



With the DBeaver, I am using:

jdbc:jtds:sqlserver://xx.xx.xx.xxx.:1433/TESTDB. HeidiSQL works as well after just supplying the IP address.



But when I use this connection string with the Squirrel, I get:



java.util.concurrent.ExecutionException: java.lang.RuntimeException:

java.sql.SQLException: Unable to create connection. Check your URL.



So I am not sure why it would work with 2 other clients, but not with the Squirrel. I really like this client, especially because of its SQL building capabilities.

I've googled several times, each trying something a little different, but not hitting on what I need to do to get Squirrel to work. I tried many variant of the connection string as well, all to no avail.



Don











------------------------------------------------------------------------------

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

Squirrel-sql-***@lists.sourceforge.net<mailto:Squirrel-sql-***@lists.sourceforge.net>

https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Don Barton
2016-05-12 02:40:10 UTC
Permalink
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 <***@hotmail.com>
Subject: Re: [Squirrel-sql-users] Cannot connect MSSQL
To: Don Barton <***@gmail.com>
Cc: squirrel-sql-***@lists.sourceforge.net
Message-ID: <DUB404-***@phx.gbl>
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
Neville Rowe
2016-05-12 06:09:36 UTC
Permalink
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
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
Subject: Re: [Squirrel-sql-users] Cannot connect MSSQL
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
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
John Hardin
2016-05-12 14:37:21 UTC
Permalink
Post by Don Barton
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/
***@impsec.org FALaholic #11174 pgpk -a ***@impsec.org
key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
142 days since the first successful real return to launch site (SpaceX)
Loading...