set up database and its connection.