For $D$ a surface, there is work of Bogomolov.  The results are weaker for  higher dimensional varieties, but they do rule out genus $0$ and genus $1$ curves, cf. the work of G. Xu, Lawrence Ein, Claire Voisin and Gianluca Pacienza.