Resonlving NullPointerException where the database params are not specified