connecting to sql server

Oxygen general issues.
mms860

connecting to sql server

Post by mms860 »

I am using oxygen 11.2 and trying to connect to sql server 2005 database. we are using windows authentication. I am using the sqljdbc4.jar and created my connection url is formatted as follows
URL: jdbc:sqlserver://servername\databasename
user: networkid
password: network password

When I click on the icon in the datasource explorer I get and error, timeout


com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host sqlimisprod1, port 1434 has failed. Error: "Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port,

All of our sql servers are using port 1433. Anyone else using ox to connect to sql and are you successful? any help or tips.
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: connecting to sql server

Post by adrian »

Hi,

The correct URL pattern for MS SQL Server looks like this:
jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value]]

So the port is after the server name and instance(database) name.
e.g. jdbc:sqlserver://servername\databasename:1433

Found a reference here: http://msdn.microsoft.com/en-us/library ... 90%29.aspx

Also note that if you are in a domain the username should also contain the domain name.
e.g. User: DOMAIN\user

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
rishistar
Posts: 1
Joined: Thu Oct 13, 2011 4:06 pm

Re: connecting to sql server

Post by rishistar »

I am trying to connect to SQL Server 2008 from Oxygen 13.0 with the following connection string
jdbc:sqlserver://localhost\SqlExpress:1433;databaseName=Darwin8;integratedSecurity=true

for a server I can connect to via SQL Server Management Studio with the server set up as .\SqlExpress

but get the following error message.

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

Any suggestions?
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: connecting to sql server

Post by adrian »

Hi,

What JDBC driver are you using?
Make sure it's the appropriate JDBC driver for SQL Server 2008:
http://msdn.microsoft.com/en-us/sqlserver/aa937724

The error seems to indicate that the JDBC driver does not find a server on port 1433 from the specified host.

Make sure you end the URL with a semicolon(;).

Check if the server is started and if 1433 is the actual port that SQL Server is configured to use in the MS SQL server management.
Adjust the port in the URL from Oxygen if it's different.

Try other URL forms as shown here:
http://msdn.microsoft.com/en-us/library/ms378428.aspx

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply