Posts

Showing posts from December, 2016

How To - Create a Database Connection Class in Java (MySQL)

This was created when i was doing a project and was creating lot of database connections and i final spend my time to create a proper class to be used by other class of my projects. special attention was given to the variable creation. so that same could be used all over the project and to make standardized the code as possible. also to reduce the amount of memory used. You can use the methods in this class to execute or get a resultset just insert the SQL query in a String format Warning- this class returns a resultset this could lead to memory leak so better to close connection which are created. Download Source Code