Database connection methods

Added a bunch of db connection methods
Comments to come