Using a Ms Sql 2005 named instance...

Dear Sirs:

Is there a way to connect to a Microsoft SQL Server 2005 that is installed as a named instance? Something like:

driverName=net.sourceforge.jtds.jdbc.Driver
connectionUrl=jdbc:jtds:sqlserver://SQLSERVER\NamedInstance:1433/TeamCity
connectionProperties.user=TeamCity
connectionProperties.password=******

I found some information here:

http://jtds.sourceforge.net/faq.html#instanceName

Thanks in advance for your help.

Luke Lanphear

2 comments
Comment actions Permalink

Luke Lanphear wrote:

Dear Sirs:

Is there a way to connect to a Microsoft SQL Server 2005 that is installed as a named instance? Something like:

driverName=net.sourceforge.jtds.jdbc.Driver
connectionUrl=jdbc:jtds:sqlserver://SQLSERVER\NamedInstance:1433/TeamCity
connectionProperties.user=TeamCity
connectionProperties.password=******

I found some information here:

http://jtds.sourceforge.net/faq.html#instanceName

Thanks in advance for your help.

Luke Lanphear


As JTDs documentaion says - either append ?instance=name to URL or
you can add to custom properties via
connectionProperties.instance=name


--
Alexey Gopachenko
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

SS has some server side code that redirects named instance connection requests to the port number of the desired instance.
You can skip this step by connecting to the port number directly.


Using SS Management studio

  1. connect to the named instance
  2. run: SELECT * FROM sys.dm_exec_connections WHERE session_id = @@SPID
  3. find the column server_port and note the port number.
  4. Specify the port number in your JDBC connection string.



I use the M$ provided JDBC Driver and this method regularly to connect to named instances of the SS db to run test scenarios.

0

Please sign in to leave a comment.