public interface ConnectionCreator
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
getConnection(java.util.Properties props)
Creates a Connection from the given Properties.
|
java.lang.String |
getConnectionURL(java.util.Properties props)
Returns the URL for the connection.
|
java.lang.String |
getDriverClassName(java.util.Properties props)
Returns the driver class for the connection.
|
java.util.Properties |
getJDBCProperties(java.util.Properties props)
Gets the full set of properties used to create the connection.
|
java.util.Collection<java.lang.String> |
listAllowedProperties()
Gets a list of the properties that are relevant to this creator.
|
java.util.Collection<JDBCParameterInfo> |
listJDBCParameterInfos(java.util.Properties connProperties)
Lists the information for jdbc parameters that are associated with the
given connection.
|
java.util.Collection<java.lang.String> |
listRequiredProperties()
Gets a list of the properties that are required for this creator to be
able to create a connection.
|
boolean |
shouldEncrypt(java.lang.String propName)
Indicates to the core getReference() logic whether a given property name
should be encrypted when persisting or not.
|
boolean |
shouldPromptForPassword(java.util.Properties props)
Indicates wether the password prompter should be invoked (when available)
for the given connection properties.
|
java.sql.Connection getConnection(java.util.Properties props) throws java.sql.SQLException
props
- the properties from the underlying DatabaseProvider
connection definitionjava.sql.SQLException
- if the connection cannot be created because the data
is wrong or the database is down.java.lang.String getConnectionURL(java.util.Properties props) throws java.sql.SQLException
props
- the properties from the underlying DatabaseProvider
connection definitionjava.sql.SQLException
- if a valid connection URL cannot be created with
the given props.java.util.Properties getJDBCProperties(java.util.Properties props) throws java.sql.SQLException
props
- the properties from the underlying DatabaseProvider
connection definitionjava.sql.SQLException
- if a valid set of properties cannot be created
from the given props.java.lang.String getDriverClassName(java.util.Properties props) throws java.sql.SQLException
java.sql.SQLException
boolean shouldEncrypt(java.lang.String propName)
boolean shouldPromptForPassword(java.util.Properties props)
props
- the connection details that might need a password prompted forjava.util.Collection<java.lang.String> listAllowedProperties()
listRequiredProperties()
java.util.Collection<java.lang.String> listRequiredProperties()
DatabaseProvider.SUBTYPE_CLASS_REFTYPE
is always implicitly
required, it does not need to be included in this list.
listAllowedProperties()
java.util.Collection<JDBCParameterInfo> listJDBCParameterInfos(java.util.Properties connProperties) throws java.sql.SQLException
These parameters are supported by the
DatabaseProvider.PARAMETERS_CLASS_REFTYPE
property, and do not
include any properties that we test separately in this layer via the
connection properties (like
user
and
password
).
connProperties
- the connection properties to get the parameter
information forjava.sql.SQLException