Connection Management and Exception Handling

Fixed crashed due to connection exceptions to MySQL server. Proper
errors are now displayed to user.