You can use the connection string to enable connection failover by setting REQUEST_HA_SESSION to true.
URL="jdbc:sybase:Tds:server1:port1,server2:port2,..., serverN:portN/mydb?REQUEST_HA_SESSION=true"
where server1:port1, server2:port2, ... , serverN:portN is the ordered failover list.
SAP jConnect attempts to connect to the first host and port specified in the failover list. If unsuccessful, goes through the list until a connection is established or until the end of the list is reached.