Blue-chip stocks are oscillating between positive and negative territory today after better-than-expected earnings from two of the nation's largest banks failed to counteract a disappointing report about consumer confidence. With roughly an hour left in the trading session, the Dow Jones Industrial Average (^DJI 0.45%) is off by 32 points, or 0.21%.

If you've been wondering about the health of the banking sector following the recent surge in interest rates, then wonder no more. Earlier today, JPMorgan Chase (JPM 1.05%) and Wells Fargo (WFC 3.04%) reported their results from the second quarter of the year. And what a quarter it was! JPMorgan's earnings shot up by 31% on year-over-year basis, while Wells Fargo's climbed by 19%.

Now, to be honest, the banks benefited tremendously from certain accounting-related boosts. Wells Fargo, for example, recorded $1.15 billion less in loan-loss provisions last quarter than it did in the same period last year. But at the same time, both banks reported strong deposit and loan growth, and JPMorgan's investment-banking arm came up huge. Fees from equity and debt underwriting at the nation's largest lender grew an astounding 38%.

Perhaps even more important than the earnings themselves, however, was what the companies' CEOs had to say about the economy. "We continue to see broad-based signs that the U.S. economy is improving and we are hopeful that, as jobs are added and confidence builds, the U.S. economy will strengthen over time," JPMorgan's Jamie Dimon noted in prepared remarks. And here's a portion of what Wells Fargo's John Stumpf said on the bank's conference call:

We continue to be optimistic about the improvements we are seeing throughout the economy. While commercial loan demand is still modest, jobs are being created, consumer confidence is increasing and the housing market continues to demonstrate strong momentum. In fact in the second quarter, the housing market movement was stronger and more broad-based than it has been since before 2008. Sales were up and residential property prices increased by 13% across the country. Yet, affordability still remains attractive even with the increased prices and higher interest rates.

It's worth noting, moreover, that not only were the comments consistent with each other, but they also echo those made by others. In two recent articles, my colleague Morgan Housel collected comments on the economy from some of the nation's most pre-eminent corporate leaders. Here's his piece on a wide swath of executives across multiple industries. And here's his article on the housing market specifically.

This optimism aside, stocks are nevertheless struggling today, thanks in part to a worse-than-expected estimate of consumer confidence. The preliminary July reading of the Thomson Reuters/University of Michigan consumer sentiment index fell to 83.9 from 84.1 in June.

Also weighing on blue chips this afternoon is the performance of Boeing (BA 0.60%). Around the middle of the trading session, news emerged that yet another of the company's flagship 787 Dreamliners has caught fire, this time on a tarmac at London's Heathrow Airport. The revelation sent Boeing's shares plummeting, and they're down by 4.3% at the time of writing.