-
1. Re: jdbc not bound
sesques Apr 19, 2004 3:21 PM (in response to rilux)Why don't you try the simplest way:
1) Copy the file postgres-ds.xml that you can find in docs/examples.jca into the deploy directory (and set the values according to your database).
2) Configure your beans with the tag in jbosscmp-jdbc.xml
3) reference the datasource with "java:/FooDS" -
2. Re: jdbc not bound
rilux Apr 22, 2004 2:49 PM (in response to rilux)Ummm... if you have a look you'd notice that the postgres-service.xml I posted IS the example postgres-ds.xml with the relevant bits changed and some comments removed for brevity.
Also, I should point out that I am avoiding entity beans in favour of DAOs and such don't have a jbosscmp-jdbc.xml file to use.
In fact, I am using XDoclet to do the EJB and XML generation. There is a configuration option you can use to specify datasources but it doesn't appear to be working. I shall direct the question at the XDoclet mailing list. -
3. Re: jdbc not bound
raja05 Apr 22, 2004 11:34 PM (in response to rilux)Try something like this in ur ejb-jar.xml
<resource-ref>
<res-ref-name>jdbc/FooDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
and in jboss.xml
<resource-ref>
<res-ref-name>jdbc/FooDS</res-ref-name>
<jndi-name>Actual JNDI Name</jndi-name>
</resource-ref> -
4. Re: jdbc not bound
jonlee Apr 23, 2004 1:12 AM (in response to rilux)Try the following XDoclet snippet:
* @ejb.resource-ref res-auth="Application" * res-name="jdbc/FooDS" * res-type="javax.sql.DataSource" * @jboss.resource-ref res-ref-name="jdbc/FooDS" * jndi-name="java:/FooDS"
The JNDI binding for your datasource is "java:/FooDS" as given by the JNDI-name, "FooDS" in the datasource definition (*-ds.xml). The res-ref-name, "jdbc/FooDS" expands to the full reference "java:com/env/jdbc/FooDS".
Hope that helps.