Creating a connection to a database