This content has been marked as final.
Show 4 replies
-
1. Re: Connection properties via @Ressource
ejb3workshop Jan 11, 2006 5:14 AM (in response to martinganserer)Hi Martin,
Can you just make sure you use @Resource rather then @Ressource like you mentioned in the subject. Might have just been a typo, I hope. The connection details are specified in a JDBC Datasource configuration file which you need to deploy.
Here is an example of a PostgreSQL one (postgres-ds.xml):
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>PostgresDS</jndi-name>
<connection-url>jdbc:postgresql://localhost:5432/jboss</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>userid</user-name>
<password> password </password>
</local-tx-datasource>
</datasources>
Just make sure the drivers are installed into the lib directory. The xml file shown above goes into the deploy directory. Then all you need to do is to specify the Resource by name. -
2. Re: Connection properties via @Ressource
ejb3workshop Jan 11, 2006 5:14 AM (in response to martinganserer)it should have read as :
<datasources> <local-tx-datasource> <jndi-name>PostgresDS</jndi-name> <connection-url>jdbc:postgresql://localhost:5432/jboss</connection-url> <driver-class>org.postgresql.Driver</driver-class> <user-name>postgres</user-name> <password>postgres</password> </local-tx-datasource> </datasources>
-
3. Re: Connection properties via @Ressource
martinganserer Jan 11, 2006 5:17 AM (in response to martinganserer)Hi,
thank you. But I didn't mean the database connection settings.
I would like to get username and password of the app server connection.
Thanks -
4. Re: Connection properties via @Ressource
ejb3workshop Jan 11, 2006 2:12 PM (in response to martinganserer)Are you talking about the JAAS Principal ?
Alex