Designing and Implementing a database connection