This practice is actually coded in the ServiceLocator
pattern of the
J2EE patterns book ( I think that book is on-line btw).
I tried to do this with some non-JDBC related connections but ran into some "stale" connection problems, so just beware if you start using the technique for other things.
Oh... and if you want to do what Tony is suggesting it can look something like this:
[ December 10, 2004: Message edited by: Robert Hayes ]