It’s been too long, I didnt get time to post anything OpenSource. So here I am again with one simple class Database, to connect to MySQL in Java. You can use this class in 2 ways –