U.S. stocks rose for a second day on Tuesday on optimism that a solution to Greece's debt crisis was near although underlying nervousness was reflected in low volume.

The Dow Jones industrial average <.DJI> gained 144.98 points, or 1.20 percent, to 12,188.54, according to the latest available figures. The Standard & Poor's 500 Index <.SPX> gained 16.57 points, or 1.29 percent, to 1,296.67. The Nasdaq Composite Index <.IXIC> gained 41.03 points, or 1.53 percent, to 2,729.31.

(Reporting by Chuck Mikolajczak; Editing by Kenneth Barry)