x
login about faq Site discussion (meta-askssc)

ODBC Connection to SQL Server Database

I am opening a database connection to SQL Server 2008 mirrored principal database with ODBC from Java program. Can we specify mirrored node with connection string or use any other driver in Java in order to automatic failover of connection in case the database fails over.

more ▼

asked Jan 26 '12 at 12:13 PM in Default

inder gravatar image

inder
201 9 16 20

@Inder are you using ODBC or JDBC?

Jan 26 '12 at 09:15 PM Usman Butt
(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

I believe that the name is Failover_Partner, i.e.

Driver={SQL Server Native Client 10.0}; 
Server=YOUR_SERVER_NAME\INSTANCE_NAME;
Failover_Partner=YOUR_MIRROR_ADDRESS;
Database=DB_NAME;
/*creds go here or Trusted_Connection=yes is specified */

Oleg

more ▼

answered Jan 26 '12 at 12:50 PM

Oleg gravatar image

Oleg
15.4k 1 4 24

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x41

asked: Jan 26 '12 at 12:13 PM

Seen: 305 times

Last Updated: Jan 26 '12 at 12:13 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.