File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How To Access Objects Returned From A Helper/Utility Class?

 
JiaPei Jen
Ranch Hand
Posts: 1309
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wouldn't you just do this:
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic