From: Bill H. <bi...@lo...> - 2003-09-05 23:16:44
|
Hi Keith, On Fri, 5 Sep 2003, Cochran, Keith wrote: > I'm connecting to two different databases in my application. I'm getting a > null pointer exception when trying to connect to the second one, and I'm > wondering how to do this properly. Here are my steps: > > 1. Set Class.forName() > 2. Set properties for first db. (pool name is proxool.first) > 3. Do a ProxoolFacade.registerConnectionPool() for these properties > 4. Get a connection (this works fine) And, presumably, you set the URL too? I guess you do or it wouldn't work. > 5. set properties for second db (pool name is proxool.second) > 6. Do a ProxoolFacade.registerConnectionPool() for these new properties > 7. get a connection (null pointer exception) I think I need to see your code. Your steps sound reasonable. What would be _really_ interesting is to know _where_ the NullPointerException occured ;-) And, even better, a stack trace. Other things to try: Swap the pools round. Is it always the one called "proxool.second" or is it the second one you register? Trying opening more than one connection on the first pool and check that it isn't just that your driver won't let you open two connections. What is your driver, by the way? Do you have logging setup, or is everything just logging to stdout? It's not too hard to setup something like Log4J and you'll find it very useful (there's more information on logging in the user guide on the web site). At the very least, you should switch on debugging. Let me know how you get on. Cheers, Bill Horsman |