Hi,
* Prabu Subroto
I want to put my connection code into one class but I don't know how to make another class can use the same connection, such as under below in my code....
Some people say that Singletons are used too often, but this seems to be a classic application. If you don't know what a singleton is, you should read the book Design Patterns. Untested, just entered into the mail editor: public class Resource { protected static Resource myInstance; private Resource() { // Do some serious initialization here } public static Resource getInstance() { if (myInstance == null) { myInstance = new Resource(); } return myInstance; } } Now you can access the resource from anywhere using myResource = Resource.getInstance(); Thorsten -- This sentence no verb.