In which poem did Tennyson write "Tis better to have loved and lost, Than never to have loved at all"?

In which poem did Tennyson write "Tis better to have loved and lost, Than never to have loved at all"?