Bob,

Thanks for suggestion but that is not exactly what I wanted to do.
Currently, what I have in my ejb-jar.xml contains the following entry

        <env-entry>
          <env-entry-name>smart/DSJndi</env-entry-name>
          <env-entry-type>java.lang.String </env-entry-type>
          <env-entry-value>SmartPool</env-entry-value>
        </env-entry>

In my code,

    private void lookupEnv()
    {
        Context initContext;
        try {
            initContext = new InitialContext();
            dsJndi = (String)
initContext.lookup("java:/comp/env/smart/DSJndi");
        }
        catch (Exception e) {
            java.io.CharArrayWriter cw = new java.io.CharArrayWriter();
            java.io.PrintWriter pw = new java.io.PrintWriter(cw,true);
            e.printStackTrace(pw);
            logCategory.error(cw.toString());
        }
    }


    private Connection getConnection() throws Exception {
        Context ctx = new InitialContext();
        javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup(dsJndi);
        return ds.getConnection();
    }

On Jboss, I need to change the value of this environment to java:/SmartPool
and it works. This approach is more or less the same as what you suggested.

I don't want to modify the ejb-jar.xml file whenever I have to deploy it on
different containers. I would prefer an approach that allows me to use the
same ejb-jar.xml file. If I have to move between containers, I need only to
modify those vendor-specific deployment descriptors.

Thanks all for comments.

Nguyen Thanh Phong                           Tel: 84-8-837 25 06/837 25 07
Saigon Software Development Company (SDC)    Fax: 84-8-837 25 11
10 Co Giang Street, Dist I, HCMC             Email:
[EMAIL PROTECTED]
Vietnam



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to