I have a helper/utility class that specializes in creating a connection pool and providing connections.
How do I access this Connection (conn) returned from the helper/utility class in another class? (i.e. I want to use conn.createStatement(); and query a database in TestServlet class.) [ July 09, 2003: Message edited by: JiaPei Jen ]
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
If your helper is a connection pool you need logic something like this:
This has been done zillions of times. Try google for "java connection pool" to find some ready to use. Is that the kind of thing you were asking?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: How To Access Objects Returned From A Helper/Utility Class?