On Wed, 17 Oct 2001 13:00, Serge Knystautas wrote:
> In James, we use Excalibur/Cornerstone to define Excalibur-style
> datasources... is there a way to expose these same datasources as J2EE
> style datasource?
>
> Said in code... assume the datasource gets configured in the conf file is
> called "maildb". Now we get the Connection this way...
>
> DataSourceSelector datasources =
> (DataSourceSelector)componentManager.lookup( DataSourceSelector.ROLE );
> DataSourceComponent datasource =
> (DataSourceComponent)datasources.select("maildb");
> Connection conn = datasource.getConnection();
>
>
> I'd like to be able to do...
>
> Context env = (Context) new InitialContext().lookup("java:comp/env");
> DataSource source = (DataSource) env.lookup("jdbc/maildb");
> Connection conn = source.getConnection();
>
> I don't really know how the Context or InitialContext approach works, but
> it doesn't seem like it would be that difficult.
It is not really supported at this stage. It would not be too hard to add -
especially as there is already a JNDI framework in excalibur. But I am not
sure that there is a benefit in using an industrial strength naming api when
a thin layer will suffice.
--
Cheers,
Pete
*------------------------------------------------------*
| "Common sense is the collection of prejudices |
| acquired by age 18. " -Albert Einstein |
*------------------------------------------------------*
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]