You need to create a utility class for JDBC Connection. Inside this utility class write a static method which returns JDBC connection object. This way any class can access the connection object. Moreover inside your method do not create connection object if it is not null. Please let me know you need any further help.