In this paper, based on the known first integral method and the Riccati sub-ordinary differential equation (ODE) method, we try to seek the exact solutions of the general Gardner equation and the general Benjamin-Bona-Mahoney equation. As a result, some traveling wave solutions for the two nonlinear equations are established successfully. Also we make a comparison between the two methods. It turns out that the Riccati sub-ODE method is more effective than the first integral method in handling the proposed problems, and more general solutions are constructed by the Riccati sub-ODE method.