org.jpox.util
Class FailoverUtils
java.lang.Object
org.jpox.util.FailoverUtils
- public class FailoverUtils
- extends java.lang.Object
Utility class for Failover
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 |
FailoverUtils
public FailoverUtils()
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 datasourcesfailOnError
- 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.