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

avatar image

inder
211 18 19 25

@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

avatar image

Oleg
17.2k 3 7 28

(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

SQL Server Central

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

Topics:

x57

asked: Jan 26, 2012 at 12:13 PM

Seen: 775 times

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

Copyright 2016 Redgate Software. Privacy Policy