add database connection method