org.jpox.util
Class FailoverUtils

java.lang.Object
  extended byorg.jpox.util.FailoverUtils

public class FailoverUtils
extends java.lang.Object

Utility class for Failover


Constructor Summary
FailoverUtils()
           
 
Method Summary
static java.sql.Connection getConnection(javax.sql.DataSource[] ds, boolean failOnError)
          Obtain a connection from the datasources, starting on the first datasource until the last one in the list in case is not able to obtain the connection.
static java.sql.Connection getConnection(javax.sql.DataSource[] ds, java.lang.String user, java.lang.String password, boolean failOnError)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FailoverUtils

public FailoverUtils()
Method Detail

getConnection

public static java.sql.Connection getConnection(javax.sql.DataSource[] ds,
                                                boolean failOnError)
                                         throws java.sql.SQLException
Obtain a connection from the datasources, starting on the first datasource until the last one in the list in case is not able to obtain the connection.

Parameters:
ds - the array of datasources
failOnError - if fail on first error found, or only on the last one if unable to obtain the connection
Returns:
the Connection or null if ds is null
Throws:
java.sql.SQLException

getConnection

public static java.sql.Connection getConnection(javax.sql.DataSource[] ds,
                                                java.lang.String user,
                                                java.lang.String password,
                                                boolean failOnError)
                                         throws java.sql.SQLException
Throws:
java.sql.SQLException


Copyright © -2007 . All Rights Reserved.