public class SqlConnectionProvider
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
SqlConnectionProvider()
Constructs a default provider.
|
protected |
SqlConnectionProvider(java.lang.String url)
Constructs a provider with a fallback data source.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getFallbackConnectionUrl()
Returns the URL of the fallback connection.
|
static java.sql.Connection |
newConnection()
Creates a new connection to the default data source.
|
protected java.sql.Connection |
newFallbackConnection()
Creates a new connection as the fallback option.
|
protected SqlConnectionProvider()
protected SqlConnectionProvider(java.lang.String url)
url
- the JDBC URLjava.lang.IllegalArgumentException
- if the given URL is nullprotected final java.lang.String getFallbackConnectionUrl()
null
if no
fallback connection is specifiedprotected java.sql.Connection newFallbackConnection() throws java.sql.SQLException
java.sql.SQLException
- if any SQL error occursnewConnection(String)
public static final java.sql.Connection newConnection()