On Jan 3, 2007, at 2:53 AM, Raj Saini wrote:

Hi David,

David Blevins wrote:

On Dec 27, 2006, at 8:09 PM, Raj Saini wrote:


The related functionality for those isn't implemented (should be soon). In the mean-time would you be interested in doing one of these?

    [OPENEJB-355] Example: @Resource for Field Injection
    [OPENEJB-356] Example: @Resource for Setter Injection
How do I configure a resource (e.g. a data source or a mail) into OpenEJB3? In other Java EE servers, resources are configured through server configuration files. I have no idea how to do it in OpenEJB.

For these examples I'd go with only env-entry items. The example for using @Resource for JDBC lookup is a different example (OPENEJB-358).

But to answer the question, you can have an openejb.conf file in your test case as well as an openejb-jar.xml file to link to the data source configured in your openejb.conf. Similarly, we can also create an openejb.conf and openejb-jar.xml for you dynamically and give you the default data source if you need one. At the moment the default is HSqlDB.

I'd like to provide a way to configure the datasource through properties so in the most ideal scenario you'd only need one extra property in your InitialContext creation code to get a datasource configured and available to your bean.

There was some discussion on this a long while back:

http://www.mail-archive.com/[email protected]/msg00171.html

Good read.

-David

Reply via email to