established database connection and some parsing for links