public interface DatasourceConfiguration
Implementation of this interface should be registered in the ModuleConfiguration
lookup.
Modifier and Type | Method and Description |
---|---|
void |
bindDatasourceReference(String referenceName,
String jndiName)
Binds the data source reference name with the corresponding data source which is
identified the given JNDI name.
|
void |
bindDatasourceReferenceForEjb(String ejbName,
String ejbType,
String referenceName,
String jndiName)
Binds the data source reference name with the corresponding data source which is
identified the given JNDI name.
|
Datasource |
createDatasource(String jndiName,
String url,
String username,
String password,
String driver)
Creates the data source definition in the module.
|
String |
findDatasourceJndiName(String referenceName)
Finds JNDI name of the data source which is mapped to the given reference name.
|
String |
findDatasourceJndiNameForEjb(String ejbName,
String referenceName)
Finds JNDI name of the data source which is mapped to the given reference name in the scope the EJB.
|
Set<Datasource> |
getDatasources()
Returns the data sources defined in the module.
|
boolean |
supportsCreateDatasource()
Returns true if data source creation is supported, false otherwise.
|
Set<Datasource> getDatasources() throws ConfigurationException
ConfigurationException
- reports problems in retrieving data source
definitions.boolean supportsCreateDatasource()
Datasource createDatasource(String jndiName, String url, String username, String password, String driver) throws UnsupportedOperationException, ConfigurationException, DatasourceAlreadyExistsException
jndiName
- data source JNDI name.url
- database URL.username
- database user.password
- user's password.driver
- fully qualified name of the database driver class.UnsupportedOperationException
- if operation is not supported.ConfigurationException
- reports problems in creating data source
definition.DatasourceAlreadyExistsException
- if a data source with the same
JNDI name already exists.void bindDatasourceReference(String referenceName, String jndiName) throws ConfigurationException
referenceName
- name used to identify the data sourcejndiName
- JNDI name of the data sourceConfigurationException
- if there is some problem with data source configurationvoid bindDatasourceReferenceForEjb(String ejbName, String ejbType, String referenceName, String jndiName) throws ConfigurationException
ejbName
- EJB nameejbType
- EJB type - the possible values are
org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.SESSION,
org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.ENTITY and
org.netbeans.modules.j2ee.dd.api.ejb.EnterpriseBeans.MESSAGE_DRIVENreferenceName
- name used to identify the data sourcejndiName
- JNDI name of the data sourceConfigurationException
- if there is some problem with data source configurationString findDatasourceJndiName(String referenceName) throws ConfigurationException
referenceName
- reference nameConfigurationException
- if there is some problem with data source configurationString findDatasourceJndiNameForEjb(String ejbName, String referenceName) throws ConfigurationException
ejbName
- EJB namereferenceName
- reference nameConfigurationException
- if there is some problem with data source configuration