hi all:
I am building a web app now and everything works fine. However, instead of asking my DAO(Data access object) to connect to the DB(mysql) to retreive data for my
servlet and
jsp and stuff, I want to create a virtual database which holds the data.
I know that the database will be reset everytime a new user log-in but thats fine. All I need is that the database will reflect the changes within the session.
My question is that how should I designed my DB class so that it satisfy what I needed.
The current problem i have is that each time my DAO have to create an instance of my DB class (which reset all the changes that user made).
To make my question simpler for those who don't want to READ:
How can I create a class which other objects within the same package can just reference to it and the class itself have 1 instance only??
thx