the database connenction and methods