dbTalk Databases Forums  

HA connection string

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss HA connection string in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jose-Miguel Torres
 
Posts: n/a

Default HA connection string - 10-28-2009 , 09:29 AM






Good Day,
Could you provide an example for using Java Code in order
to connect to ASA 11 + High Availability..?
The docs do not include a guides for this environment..
just for a regular java app connecting t a single node

Thank you
JMT

Reply With Quote
  #2  
Old   
Nick Elson [Sybase iAnywhere]
 
Posts: n/a

Default Re: HA connection string - 10-28-2009 , 12:13 PM






First things first you must be using the iAnywhere JDBC
driver and *not* JConnect [JConn does not use the
correct protocol to do this].

After that it should just be a matter of using the correct
connection string [same as ODBC, E/SQL, OLEDB . . . .]

If your client software is 10.0.x+ you simply need to
specify the alternate-server-name in your ENG=
or ServerName= connection parameter and the
client libraries and servers will figure it out after
that point. [Note: the alternate-server-name is
defined at the mirror/primary servers via the -sn
switch.]


"Jose-Miguel Torres" wrote in message
news:4ae86345.1f62.1681692777 (AT) sybase (DOT) com...
Quote:
Good Day,
Could you provide an example for using Java Code in order
to connect to ASA 11 + High Availability..?
The docs do not include a guides for this environment..
just for a regular java app connecting t a single node

Thank you
JMT

Reply With Quote
  #3  
Old   
Josh Savill [Sybase]
 
Posts: n/a

Default Re: HA connection string - 10-28-2009 , 12:20 PM



Very simple example!

This example uses the iAnywhere JDBC Driver. The key is setting the ENG= to the alternative server
name for the HA environment that is specified using the -sn option when starting the database
servers. The primary and the mirror servers must have the same name for the -sn option.

import java.io.*;
import java.sql.*;

public class JDBCConnect
{
public static void main( String args[] )
{
try
{

DriverManager.registerDriver( (Driver) Class.forName(
"ianywhere.ml.jdbcodbc.jdbc3.IDriver").newInstance ());

Connection conn = DriverManager.getConnection(
"jdbc:ianywhere:driver=SQL Anywhere 11;ENG=alternative_server_name;uid=DBA;pwd=sql" );

if( conn == null )
{
System.out.println("==== SQL Anywhere Connection Failed!");
}
else
{
System.out.println("==== SQL Anywhere Connection Success!");
}

conn.close();
}
catch (SQLException sqe)
{
System.out.println("Unexpected exception : " +
sqe.toString() + ", sqlstate = " +
sqe.getSQLState());
System.exit(1);
}
catch (Exception e)
{
e.printStackTrace();
System.exit(1);
}

System.exit(0);
}
}

--
Joshua Savill
Sybase Inc. - Product Manager


Jose-Miguel Torres wrote:
Quote:
Good Day,
Could you provide an example for using Java Code in order
to connect to ASA 11 + High Availability..?
The docs do not include a guides for this environment..
just for a regular java app connecting t a single node

Thank you
JMT

Reply With Quote
  #4  
Old   
Josh Savill [Sybase]
 
Posts: n/a

Default Re: HA connection string - 10-28-2009 , 01:25 PM



Nick is right. There is no ALTERNATIVE_SERVER_NAME connection property available in the jConnect
driver at this time. The jConnect team is working on providing support for SQL Anywhere HA in the
next release. There is no set date for this release at this time.

--
Joshua Savill
Sybase Inc. - Product Manager


Nick Elson [Sybase iAnywhere] wrote:
Quote:
First things first you must be using the iAnywhere JDBC
driver and *not* JConnect [JConn does not use the
correct protocol to do this].

After that it should just be a matter of using the correct
connection string [same as ODBC, E/SQL, OLEDB . . . .]

If your client software is 10.0.x+ you simply need to
specify the alternate-server-name in your ENG=
or ServerName= connection parameter and the
client libraries and servers will figure it out after
that point. [Note: the alternate-server-name is
defined at the mirror/primary servers via the -sn
switch.]


"Jose-Miguel Torres" wrote in message
news:4ae86345.1f62.1681692777 (AT) sybase (DOT) com...
Good Day,
Could you provide an example for using Java Code in order
to connect to ASA 11 + High Availability..?
The docs do not include a guides for this environment..
just for a regular java app connecting t a single node

Thank you
JMT

Reply With Quote
  #5  
Old   
Jose-Miguel Torres
 
Posts: n/a

Default Re: HA connection string - 10-28-2009 , 02:00 PM



Nick /Joshua

Thanks a lot ! I'll try that

JMT

Quote:
Nick is right. There is no ALTERNATIVE_SERVER_NAME
connection property available in the jConnect driver at
this time. The jConnect team is working on providing
support for SQL Anywhere HA in the next release. There is
no set date for this release at this time.

--
Joshua Savill
Sybase Inc. - Product Manager


Nick Elson [Sybase iAnywhere] wrote:
First things first you must be using the iAnywhere JDBC
driver and *not* JConnect [JConn does not use the
correct protocol to do this].

After that it should just be a matter of using the
correct connection string [same as ODBC, E/SQL, OLEDB .
. . .]
If your client software is 10.0.x+ you simply need to
specify the alternate-server-name in your ENG=
or ServerName= connection parameter and the
client libraries and servers will figure it out after
that point. [Note: the alternate-server-name is
defined at the mirror/primary servers via the -sn
switch.]


"Jose-Miguel Torres" wrote in message
news:4ae86345.1f62.1681692777 (AT) sybase (DOT) com...
Good Day,
Could you provide an example for using Java Code in
order >> to connect to ASA 11 + High Availability..?
The docs do not include a guides for this
environment.. >> just for a regular java app connecting t
a single node
Thank you
JMT

Reply With Quote
  #6  
Old   
Josh Savill [Sybase]
 
Posts: n/a

Default Re: HA connection string - 10-28-2009 , 02:38 PM



JMT,

If you want to use jConnect, then you'll need to download EBF 16508 or higher of 6.05 for HA support
with SQL Anywhere. You can find the jConnect download at downloads.sybase.com. The current EBF is
the following:

jConnect for JDBC - EBF 16903: 6.05 ESD #16 6.0.5 11 Jun 2009 EBF/Patch

--
Joshua Savill
Sybase Inc. - Product Manager


Jose-Miguel Torres wrote:
Quote:
Nick /Joshua

Thanks a lot ! I'll try that

JMT

Nick is right. There is no ALTERNATIVE_SERVER_NAME
connection property available in the jConnect driver at
this time. The jConnect team is working on providing
support for SQL Anywhere HA in the next release. There is
no set date for this release at this time.

--
Joshua Savill
Sybase Inc. - Product Manager


Nick Elson [Sybase iAnywhere] wrote:
First things first you must be using the iAnywhere JDBC
driver and *not* JConnect [JConn does not use the
correct protocol to do this].

After that it should just be a matter of using the
correct connection string [same as ODBC, E/SQL, OLEDB .
. . .]
If your client software is 10.0.x+ you simply need to
specify the alternate-server-name in your ENG=
or ServerName= connection parameter and the
client libraries and servers will figure it out after
that point. [Note: the alternate-server-name is
defined at the mirror/primary servers via the -sn
switch.]


"Jose-Miguel Torres" wrote in message
news:4ae86345.1f62.1681692777 (AT) sybase (DOT) com...
Good Day,
Could you provide an example for using Java Code in
order >> to connect to ASA 11 + High Availability..?
The docs do not include a guides for this
environment.. >> just for a regular java app connecting t
a single node
Thank you
JMT

Reply With Quote
  #7  
Old   
Jose-Miguel Torres
 
Posts: n/a

Default Re: HA connection string - 10-29-2009 , 08:37 AM



Joshua,
Thanks again.!
We'll try the ianywhere driver first and see how it goes
from there.
Anyway , i'll let you know.

Regards
Jose-Miguel

Quote:
JMT,

If you want to use jConnect, then you'll need to download
EBF 16508 or higher of 6.05 for HA support with SQL
Anywhere. You can find the jConnect download at
downloads.sybase.com. The current EBF is the following:

jConnect for JDBC - EBF 16903: 6.05 ESD #16 6.0.5
11 Jun 2009 EBF/Patch

--
Joshua Savill
Sybase Inc. - Product Manager


Jose-Miguel Torres wrote:
Nick /Joshua

Thanks a lot ! I'll try that

JMT

Nick is right. There is no ALTERNATIVE_SERVER_NAME
connection property available in the jConnect driver
at >> this time. The jConnect team is working on providing
support for SQL Anywhere HA in the next release. There
is >> no set date for this release at this time.

--
Joshua Savill
Sybase Inc. - Product Manager


Nick Elson [Sybase iAnywhere] wrote:
First things first you must be using the iAnywhere
JDBC >>> driver and *not* JConnect [JConn does not use the
correct protocol to do this].

After that it should just be a matter of using the
correct connection string [same as ODBC, E/SQL, OLEDB
. . .]
If your client software is 10.0.x+ you simply need to
specify the alternate-server-name in your ENG=
or ServerName= connection parameter and the
client libraries and servers will figure it out after
that point. [Note: the alternate-server-name is
defined at the mirror/primary servers via the -sn
switch.]


"Jose-Miguel Torres" wrote in message
news:4ae86345.1f62.1681692777 (AT) sybase (DOT) com...
Good Day,
Could you provide an example for using Java Code in
order >> to connect to ASA 11 + High Availability..?
The docs do not include a guides for this
environment.. >> just for a regular java app connecting
t >> a single node
Thank you
JMT

Reply With Quote
  #8  
Old   
Josh Savill [Sybase]
 
Posts: n/a

Default Re: HA connection string - 10-29-2009 , 12:05 PM



I would recommend using the iAnywhere JDBC driver.

--
Joshua Savill
Sybase Inc. - Product Manager



Jose-Miguel Torres wrote:

Quote:
Joshua,
Thanks again.!
We'll try the ianywhere driver first and see how it goes
from there.
Anyway , i'll let you know.

Regards
Jose-Miguel

JMT,

If you want to use jConnect, then you'll need to download
EBF 16508 or higher of 6.05 for HA support with SQL
Anywhere. You can find the jConnect download at
downloads.sybase.com. The current EBF is the following:

jConnect for JDBC - EBF 16903: 6.05 ESD #16 6.0.5
11 Jun 2009 EBF/Patch

--
Joshua Savill
Sybase Inc. - Product Manager


Jose-Miguel Torres wrote:
Nick /Joshua

Thanks a lot ! I'll try that

JMT

Nick is right. There is no ALTERNATIVE_SERVER_NAME
connection property available in the jConnect driver
at >> this time. The jConnect team is working on providing
support for SQL Anywhere HA in the next release. There
is >> no set date for this release at this time.
--
Joshua Savill
Sybase Inc. - Product Manager


Nick Elson [Sybase iAnywhere] wrote:
First things first you must be using the iAnywhere
JDBC >>> driver and *not* JConnect [JConn does not use the
correct protocol to do this].

After that it should just be a matter of using the
correct connection string [same as ODBC, E/SQL, OLEDB
. . .]
If your client software is 10.0.x+ you simply need to
specify the alternate-server-name in your ENG=
or ServerName= connection parameter and the
client libraries and servers will figure it out after
that point. [Note: the alternate-server-name is
defined at the mirror/primary servers via the -sn
switch.]


"Jose-Miguel Torres" wrote in message
news:4ae86345.1f62.1681692777 (AT) sybase (DOT) com...
Good Day,
Could you provide an example for using Java Code in
order >> to connect to ASA 11 + High Availability..?
The docs do not include a guides for this
environment.. >> just for a regular java app connecting
t >> a single node
Thank you
JMT

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.