This content has been marked as final.
Show 3 replies
-
1. Re: Datasource name
nickarls Feb 26, 2008 1:35 PM (in response to marx3)
Marek Nazarko wrote on Feb 26, 2008 01:31 PM:
Hello
Is it possible to know, which datasource uses server?
I need to make some manual modifications in database via JDBC at startup of Seam application, so I want to use datasource to get connection.
I need some translation here ;-) Are you asking how to list what datasources are available to the server? Check the JNDI. If not, then the answer might not apply...
-
2. Re: Datasource name
marx3 Feb 26, 2008 1:54 PM (in response to marx3)Application at start is bind to some datasource - entity manager uses it to persist etc. I want to know name of that datasource.
It's written in xxx-ds.xml like
<jndi-name>xxxDatasource</jndi-name> -
3. Re: Datasource name
nickarls Feb 26, 2008 9:05 PM (in response to marx3)Hmmm, I don't think there is any API for that. You could read your persistence.xml yourself and look through the deployed datasource-xml-files but there is probably something preventing you from reading files outside the ear/war(?)