users@glassfish.java.net

Can you use variables in glassfish-resources.xml?

From: <forums_at_java.net>
Date: Wed, 21 Sep 2011 13:18:35 -0500 (CDT)

Hello,
When we upgraded to Glassfish 3.1 I tried switching us over to use
application-specific resources, by including glassfish-resources.xml in our
EAR file.
While this techically seemed to work fine, the fact that the file is built
into the EAR poses an issue for us.
In our production release process, we typically build one EAR file and that
EAR may be deployed in staging, demo, and/or production.
But certain pieces of data could be different across these environments, for
example the database username might be X on staging but Y on production.
Is there a way to define the database username referenced in
glassfish-resources.xml via some external variable?
Thank you,
chris

p.s.  Example glassfish-resources.xml file:
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application
Server 3.1 Resource Definitions//EN"
    "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
    <jdbc-connection-pool...>
        ...
        <property name="user" value="%username%"/>           
<-- Can we use a variable here?!?
        <property name="password" value="%password%"/>
    </jdbc-connection-pool>
    ...
</resources>
 


--
[Message sent by forum member 'ckorinek']
View Post: http://forums.java.net/node/845541