private Connection getConnection()
    {
        try
        {
            Class.forName("com.mysql.jdbc.Driver");
            return DriverManager.getConnection("jdbc:mysql://" + hostname + "/" + databaseName + "?user=" + username + "&password=" + password);
        }
        catch (ClassNotFoundException e)
        {
            handleError("Cannot find MySQL driver!", e);
        }
        catch (SQLException e)
        {
            handleError("Cannot connect to database!", e);
        }

        return null;
    }