public interface ConnectionProvider
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection(DataSource[] ds)
Obtain a connection from the datasources, starting on the first datasource, and if unable to obtain
a connection skips to the next one on the list, and try again until the list is exhausted.
|
void |
setFailOnError(boolean flag)
Flag if an error causes the operation to thrown an exception, or false to skip to next DataSource.
|
void setFailOnError(boolean flag)
flag
- true if to fail on errorConnection getConnection(DataSource[] ds) throws SQLException
ds
- the array of datasources. An ordered list of datasourcesds
is null, or null if the DataSources has returned
a null as connectionSQLException
- in case of error and failOnError is true or the error occurs while obtaining
a connection with the last DataSource on the listCopyright © 2015. All rights reserved.