0

There is a cool program out there called DBEdit2, which can be used for SQL Server. Here is where you can get it free:

http://dbedit2.sourceforge.net/

The problem is that I can't make it work! It gives me the following error (conf info crossed out):

enter image description here

This is what I put in the login details:

enter image description here

And this is what I get if I click details:

enter image description here

Any ideas at all? Can anyone else make this program work?

I've made sure that I have my SQL Server set to allow both SQL Server and Windows authentication mode.

I've ensured that the server is running and that I have browser running.

I don't know.

3
  • 1
    "Unknown host" seems pretty clear to me. Unfortunately you removed the interesting part: how you specify the host. But as far as I can see you have a \ (backslash) in the hostname which is not correct Nov 6 '15 at 14:28
  • The host is the SQL Server, right? But the server name IS what I put, with the backslash. If I go to SSMS, and right-click on the server, click Properties, it has under Name: L*8428\JSS14 - I've starred out bits for confidentiality. Nov 6 '15 at 16:47
  • 1
    L*8428\JSS14 is not a valid hostname ( the part \JSS14 is wrong). The format is //servername/databasename no backslash allowed: jtds.sourceforge.net/faq.html#urlFormat Nov 6 '15 at 17:49
1

As @a_horse_with_no_name points out, your connection string is incorrect. The java jdbc driver needs to know the instance name ( it doesn't play well with the backslash notation ), which will be overridden if you're specifying the port ( 1433 is the default instance port - you might not have to specify the instance name at all if that's what you're trying to connect to ).

Try something along the lines of this instead for your connection string:

jdbc:jtds:sqlserver://JT__428/j___test_db;instance=J__MS14

1
  • This is the same syntax I use to connect JIRA (a Java app) to a named instance and it works. Nov 6 '15 at 15:22
-1

The solution in the end was two fold:

1) firstly ensure that your TCP/IP is switched on. To do this go to Configuration Manager and check under SQL Server Network Configuration > Protocol and TCP/IP - rClick and select Enable.

2) secondly, if you have a named instance, like I did, DBEdit2 didn't seem to like it when I tried the backslash and name of instance. In other words, it didn't like this:

jdbc:jtds:sqlserver://MyHostName\MyInstanceName:1433/test_db

But you can set the port of the TCP/IP to another port, other than the standard 1433, and simply change the connection string in DBEdit2 to connect. To set the port, go back to the TCP/IP settings mentioned above, and set all references to the Port to something like 1434, then restart the instance. Then alter the connection string accordingly, only listing the host name:

jdbc:jtds:sqlserver://MyHostName:1434/test_db

Incidentally, to find the host name, you can rClick the service in SSCM and you'll find it on the Service tab.

1
  • These steps are pretty flawed. Item 1 is irrelevant to the question and the error message (which is the same if TCP/IP is enabled or not). It is a secondary issue that is a separate question. Item 2 is unnecessary extra work, and misstates what is happening. DBEdit2 doesn't care about the instance name. The issue is 100% with the JDBC driver, and the fix is to simply use the proper syntax as shown in @Avarkx's answer (and linked to in a comment by a_horse_with_no_name). Why change the port and advise others to do that? I installed DBEdit2 and the proper syntax works for a named instance. Nov 8 '15 at 6:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.