Database connection for teacher part