...
See Containers and Resources for a complete list of supported DataSource properties. See DataSource Password Encryption for information on specifying non-plain-text database passwords in your openejb.xml file. See Common DataSource Configurations for a list of the commonly used databases and their driver configurations.
You may also need data partitioning per customer or depending on any other business criteria. That's also an available feature. See Dynamic Datasource for more details.
JNDI names for configured DataSources
...
Code Block | ||||
---|---|---|---|---|
| ||||
@Resource(name="myDerbyDatabase", type="javax.sql.DataSource".class) @Stateless public class FooBean { public void setSessionContext(SessionContext sessionContext) { DataSource dataSource = (DataSource) sessionContext.lookup("myDerbyDatabase"); } public void someOtherMethod() throws Exception { InitialContext initialContext = new InitialContext(); DataSource dataSource = (DataSource) initialContext.lookup("java:comp/env/myDerbyDatabase"); } } |
...