x

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, 2012 at 12:13 PM in Default

inder gravatar image

inder
211 16 19 22

@Inder are you using ODBC or JDBC?
Jan 26, 2012 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, 2012 at 12:50 PM

Oleg gravatar image

Oleg
15.9k 2 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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

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

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x46

asked: Jan 26, 2012 at 12:13 PM

Seen: 624 times

Last Updated: Jan 26, 2012 at 12:13 PM