users@glassfish.java.net

Re: Glassfish Beginner Setup Question

From: <glassfish_at_javadesktop.org>
Date: Wed, 07 Feb 2007 15:19:32 PST

Hi there,

What you need is a "resource". Java EE recognizes anything external to your application
as "resources".

A resource is looked up an application.

However, a resource should be linked to the actual database in this case, that is
represented by your JDBC connection pool.

So, here are the steps that you should take:
- logon to the admin GUI.
- create a JDBC resource (resources/JDBC/Resources) and make it point to
  the name "myDB".
- the lookup-name or the JNDI name for this resource is say "jdbc/myDB" (can be
  any arbitrary name).
- modify the web.xml like this:
    <resource-ref>
        <res-ref-name>jdbc/myDB</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
    </resource-ref>

- Update the forum to let us know if it works or not.

Thanks,
Kedar
[Message sent by forum member 'km105526' (km105526)]

http://forums.java.net/jive/thread.jspa?messageID=202569