I'm developing a Singleton class for to do connection with database, only. After, a class to access the object for get connection and to do the query to database. However, I cannot get the connection for the object. See my class (Singleton):
Once you get your code working, you should seriously move away from using the Singleton pattern. Singletons are useful on occasion, but are probably the most overused construct in object-oriented programming. They solve very few real world problems and cause many.
Don't use singletons. Singletons considered harmful.
Well, I will to try clarify the my problem.
I'm developing a site that contains multiples connections with database. I thought of the following way: An class only that be will responsible by the connections. I will to use this class for to call the connections for I to do query, without to have that create several class for this. Only a class for connections get.