Database connection abstraction