users@glassfish.java.net

Re: changing JDBC resources programmatically

From: Glenn Holmer <gholmer_at_weycogroup.com>
Date: Fri, 14 Dec 2007 12:43:55 -0600

glassfish_at_javadesktop.org wrote:
>> What's the least painless way to make that take
> You mean the least painful way, right? ;)

Yes, pain is not an option :)

> I think you are not changing the JNDI names of the resource. It's just that the
> connection pool points to a different database now. If that's the case, restart
> of the *application* (e.g. disabling the app followed by enabling it) should
> work. I don't think you need to restart the server.

This is what I'm doing:

asadmin delete-jdbc-resource \
        --user admin --passwordfile /root/passwd.gf \
        jdbc/slm3
asadmin create-jdbc-resource \
        --user admin --passwordfile /root/passwd.gf \
        --connectionpoolid wms400 --description "Online Order Entry" \
        jdbc/slm3

Is it the best way?

-- 
____________________________________________________________
Glenn Holmer                          gholmer_at_weycogroup.com
Software Engineer                        phone: 414-908-1809
Weyco Group, Inc.                          fax: 414-908-1601