Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sharing an instance in one JVM

 
Paul Fonz
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application scope bean that controls database access. I want to use the instance of this object in a Java application I have made, which runs on the same server.
I am sure there is a way to use this instance, as it is somewhere in the Java Virtual machine on my server.
Can anyone tell me the way to do this?
Thanks,
Paul
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could take a look at the Singleton Design Pattern. http://c2.com/cgi/wiki?SingletonPattern
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic