1

I would like to know if using singleton pattern for my databaseHelper.java class, which have all database related operations i.e (Crud) is a good idea or not? I want to minimize my database hit and memory usage. I use c3p0 i.e connection pooling.

1 Answer 1

2

Strictly speaking, this is an awful idea for too many reasons.

I suggest you run a simple google search, and even here to find out why. No point in spaming this site.

For example:

Try looking at the solutions provided by the Spring framework. It would give you a much better starting point.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.