database connection code, how to connect and initialize sql stuff