Forum Stats

  • 3,723,261 Users
  • 2,244,520 Discussions
  • 7,850,383 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

SQL Server connection options

567369
567369 Member Posts: 92
edited April 2008 in SQL Developer
I've tried setting up connections to SQL Server databases but it appears to require the additional jTDS drivers. This driver needs to have stored procedures added to the master database which may not be easy to do in, say, a live financial environment that has strict controls.

Are there any other options (different JDBC drivers)?
«1

Comments

  • Barry Mcgillin-Oracle
    Barry Mcgillin-Oracle Member Posts: 1,536 Employee
    Andy,
    Right now, we have just used the jtds drivers. From SQL 2005, we have not added any extra sp's to the db to make this work. Its a simple jdbc connection. Is your TCP environment set up properly on SQL Server...

    Barry
  • 567369
    567369 Member Posts: 92
    If it's a simple matter of copying the jar file to the relevant directory in SQL Developer then I'll give it a go. But if it requires the installation of Stored Procedures in the Master database on SQL Server (as stated in the jTDS documentation) then I'd prefer to use an alternative driver if it were available that doesn't require any upload to SQL Server.
  • Barry Mcgillin-Oracle
    Barry Mcgillin-Oracle Member Posts: 1,536 Employee
    When you get the jar, go to Tools > Preferences > Database> Thirdparty drivers

    add the jar file here and set up your connection thru the navigator

    Give it a whizz and let us know how you get on.

    B
  • 567369
    567369 Member Posts: 92
    Found the directory, copied the jar file, restarted SQL Developer and got the following errors when attempting to set up a connection...

    Retrieve database button
    Status : Failure -net.sourceforge.jtds.jdbc.Driver

    Test button
    Status : Failure -Unable to find driver: net.sourceforge.jtds.jdbc.Driver

    The file used is jtds-1.2.jar - I've also tried copying all the files in the distribution and this hasn't helped.
  • 558660
    558660 Member Posts: 255
    Did you register the jdbc driver?

    Tools -> Preferences -> Database -> Third-party JDBC Drivers
  • 567369
    567369 Member Posts: 92
    Yes - and I've double-checked that the directory is still referenced
  • 567369
    567369 Member Posts: 92
    I've still not this working. The jtds-1.2.jar file is in the correct location [C:\OracleDev\sqldeveloper\sqldeveloper\system\oracle.dbtools.thirdparty.sqlserver.1.1.2.25.79] and registered in Tools | Preferences. I've even used Winzip to look at the class file and it reports...

    Name: Driver.class
    Type: CLASS File
    File size: 9,571
    Packed size: 4,813
    Ratio: 50%
    Modified: 08/11/2005 14:06
    Path: net\sourceforge\jtds\jdbc
    CRC: 485989B1

    Is there something obvious I've missed or overlooked? Possibly something to do with the OS (Windows XP Professional SP1)?

    TIA
  • 307313
    307313 Member Posts: 244
    The jtds-1.2-dist driver needs to be downloaded from sourceforge.net

    After extracting the downloaded file from the website mentioned above, mention the path for the file jtds-1.2.jar in "Tools>>Preferences>>Database>>Third Party JDBC Drivers List"
    This should work

    Regards
  • 567369
    567369 Member Posts: 92
    Yes - I've already done what you've said and it doesn't work.

    I'm going to try putting it into a different directory and try from there.
  • Barry Mcgillin-Oracle
    Barry Mcgillin-Oracle Member Posts: 1,536 Employee
    Andy,

    Put the jar anywhere.....

    Run SQL Developer. Click on Tools menu, select preferences. Select database node, and expand it. click on third party drivers node. A panel will appear where you can select the jar file.

    This preference loads the jar dynamically. We do not have a specific dir for third party jars.

    Barry
  • 567369
    567369 Member Posts: 92
    I knew it would be simple!

    I wasn't actually including the file name in the entry, just used the directory location.

    It's just one of those 'doh' moments....
  • 141565
    141565 Member Posts: 14
    Hi,

    I am using SQL Server 2000 database. I have downloaded the required third party driver (jtds-1.2.jar) and specified it as part of my third part jdbc drivers from within Oracle SQL Developer.

    I am trying to connect to the SQL Server database running in my local machine. I have specified username and password. My machine name in the Hostname and the port as 1433. My connection string looks like this.

    [email protected]:1433.

    Now if I try to click on the "Retrieve Database" button I get the following error message.

    Status: Failure -Network error IOException: Connection refused: connect

    Any one has a solution. Please...

    Regards
    Raja
  • 558660
    558660 Member Posts: 255
    Assuming you have the host name and port correct, this could be a couple of things.

    By default sqlserver does not accept tcp connections. You have to enable it at the server.

    The other is a local firewall blocking the port.
  • 582804
    582804 Member Posts: 1
    You need to specify the path to include the jar file as below.
    C:\Program Files\sqldeveloper\sqldeveloper\system\oracle.dbtools.thirdparty.sqlserver.1.2.0.29.98\jtds-1.2.jar in the Add Entry window.
  • 583670
    583670 Member Posts: 1
    I have the some problem but when a add entry not apper to be saved, because next time i go there, i cant see
  • 585055
    585055 Member Posts: 3
    I didnt see a resolution to this...I am getting the same error
    Network error IOException: Connection Refused: connect.

    I have enabled the tcpip at the sqlserver and also disabled the firewall.

    Still cant connect to the sqlserver database.

    Can anyone help
  • SueHarper
    SueHarper Member Posts: 2,579
    When you add the driver in the preferences, be sure to click away from the field, as this is sometimes not saved as you have experienced.

    Regards
    Sue
  • 585055
    585055 Member Posts: 3
    Sue,
    I am getting the following error
    Network error IOException: Connection Refused: connect.

    I have enabled the tcpip at the sqlserver and also disabled the firewall.

    Still cant connect to the sqlserver database.

    Can yo help?

    Thanks,

    Rahul
  • SueHarper
    SueHarper Member Posts: 2,579
    The networkio error sounds like either you do not have the driver installed, with the SQL Developer preference set or the SQL Server database is not up and running. Can you verify both?

    Sue
  • 585055
    585055 Member Posts: 3
    Sue,

    Thanks, I am able to login now and connect to the sqlserver database.
    But i am running into another problem.

    When I try and click on tables , it gives me the following error.

    Invalid Column Name 'NAME'
    Vendor Code 207

    Any suggestions?
  • 579942
    579942 Member Posts: 7
    Hey...

    Even after adding the jar in third party servers.... its giving the same connection failure problem.

    As someone was telling... Enabled TCP/IP protocol for MS SQL SERVER and restarted the SQL SERVER, Then also the same connection failure problem is coming.

    Am I missing anything? Help me out???

    Regards,
    Naveen
  • 585296
    585296 Member Posts: 1
    edited June 2007
    It sounds like you were having the same problems connecting that I was (and it appears I had done the same things as you - enable TCP, disable firewall, etc) but I am still having problems. Can you please share what you did to make it connect?

    By the way, I have tried the windows authentication option on a local database (SQL Server 2005) on my machine, using "localhost" and [machine name] as the host name (no quotes or brackets) and also manually entering the sa ID and password. I have verified the port number too.

    Please share what I might have missed. THANKS!
    -Wayne

    Message was edited by:
    wayneds
  • 141565
    141565 Member Posts: 14
    Hi Naveen,

    I had same problem as you and user579801. I managed to resolve it by doing the following.

    1. Locate the file called IDEConnections.xml in the folder where you have installed SQL Developer (eg. c:\sql developer\sqldeveloper\system\oracle.jdeveloper.db.connection.11.1.1.0.11.42.62).
    2. Create the following entries under <connections> tag.
    <connection>
    <URL>jdbc:jtds:sqlserver://\\.\;namedPipe=true;instance=SQLDBNam;</URL>
    <ConnectionName>SQLServer</ConnectionName>
    <user>SQLUser</user>
    <ConnectionType>JDBC</ConnectionType>
    <DeployPassword>false</DeployPassword>
    <JdbcDriver>net.sourceforge.jtds.jdbc.Driver</JdbcDriver>
    <RaptorConnectionType>Microsoft SQL Server</RaptorConnectionType>
    </connection>
    3. Save the file; Close and re-open the SQL Developer and try connecting.

    Hope this will solve your problem. Good luck.

    Regards
    Raja
  • 579942
    579942 Member Posts: 7
    Hey Guys... I'm sorry...

    I was trying with a default port number 1433, but my server is running at 1778, which I could able to figure it out once ran through REGEDIT.

    Hey Wayne, Whatever you've told were absolutely Right.

    Thx, Naveen
  • 579942
    579942 Member Posts: 7
    Thanks Rajaram..
This discussion has been closed.