TORONTO - The Toronto stock market broke a six-session losing run Thursday as commodity prices clawed back some of the big losses racked up since Sunday's inconclusive Greek elections.

Prices for oil and copper advanced despite data from China showing slower than expected exports and imports in April.

The S&P/TSX composite index gained 123.32 points to 11,798.33 while the TSX Venture Exchange gained 21.23 points to 1,366.92.

The Canadian dollar was up 0.23 of a cent at 100.14 cents US after closing below parity with the U.S. dollar Tuesday for the first time in two months. The currency had lost about three-quarters of a US cent over the previous two days as traders avoided riskier assets such as commodities and resource-based currencies like the loonie.

The loonie also advanced even as the latest snapshot on Canada's trade performance came in slightly below expectations.

Statistics Canada reported that the trade surplus increased from $273 million in February to $351 million in March. Exports edged down 0.4 per cent while imports decreased 0.6 per cent during the month.

U.S. indexes also advanced with the Dow Jones industrial average up 81.17 points at 12,916.23.

The Nasdaq composite index rose 1.51 points to 2,936.22 while the S&P 500 index was ahead 8.75 points to 1,363.33.

Positive jobs data helped support stocks Thursday. Weekly jobless claims in the U.S. edged downward last week, suggesting that employers may accelerate hiring this month. Applications dropped 1,000 to a seasonally adjusted 367,000 in the week ended May 5, the U.S. Labour Department said Thursday.

The TSX has closed lower for the past six sessions, leaving the market about two per cent lower than where it started the year.

Besides the latest round of uncertainty in Europe, stocks have also been pressured by signs of slowing economies in China and the United States. Meanwhile, analysts expect talks to form a Greek government will go nowhere and that Greeks will go back to the polls in June.

There are some hopes in the markets that in new elections some Greeks who want the country to remain in the euro currency bloc will support the main pro-euro parties, facilitating the creation of a moderate coalition government.

In the meantime, Greece is being held together by an international bailout. And analysts warn that Greece could run out of money as soon as next month without a government to negotiate the next level of its bailout.

On Thursday, China's weak import growth data raised fears the world's second-biggest economy wasn't doing enough to stimulate domestic demand amid an economic slowdown.

Imports edged up 0.3 per cent to US$144.8 billion in April while exports rose 4.9 per cent to $163.3 billion, leaving a surplus of $18.4 billion, according to customs data released Thursday.

That compared with a surplus of $5.35 billion in March and a deficit of $31.5 billion in February.

China has been an important prop for a global economy still in the midst of a fragile recovery from the 2008 financial collapse and subsequent recession. Its huge appetite for energy and metals has boosted commodity prices and oil and mining stocks on the TSX.

But resource stocks and commodity prices have been hit particularly hard recently. The June crude contract on the New York Mercantile Exchange gained 53 cents to US$97.34, still down sharply from US$106 at the beginning of this month. The energy sector improved by 1.75 per cent as Suncor Energy (TSX:SU) advanced 58 cents to C$29.65.

The base metals sector gained 2.1 per cent with copper prices up four cents at US$3.70. Demand concerns had pushed the metal down almost five per cent from May 1. Teck Resources (TSX:TCK.B) climbed 87 cents to C$34.11.

Bullion prices gained $5.30 to US$1,599.50 an ounce, taking the gold sector up 1.73 per cent and Goldcorp Inc. (TSX:G) gained 32 cents to C$35.92.

Financials were also positive as Sun Life Financial (TSX:SLF) shares gained 16 cents to $22.29 as it reported that an improvement in capital markets led to quarterly net income of $686 million or $1.15 per share compared with $438 million or 73 cents in the same period last year.

Elsewhere in the sector, Royal Bank (TSX:RY) rose 85 cents to $54.22.

In other earnings news, Bombardier Inc. (TSX:BBD.B) was off seven cents at $3.62 as it reported net income $190 million in the first quarter, or 10 cents a share. That is down sharply from $220 million, or 12 cents a share a year ago. Revenue was $3.5 billion, compared with $4.7 billion last year.

Magna International Inc. (TSX:MG) posted first-quarter sales of $7.7 billion, up seven per cent from the first quarter of 2011. Canada's largest auto parts maker handed in net income of $341 million, an increase of $19 million compared with the first quarter of 2011. Magna shares gained $1.95 to $44.63.

Canadian Tire (TSX:CTC.A) posted $2.4 billion in revenue for the quarter ended March 31, up 23 per cent from the same period last year and a profit of $71 million, or 87 cents a share, up 21.5 per cent from the same period in 2011. Its shares gained $2.59 to $70.01.

European markets were positive with London's FTSE 100 index ahead 0.48 per cent, Frankfurt's DAX up 0.99 per cent and the Paris CAC 40 ahead 0.67 per cent.

Earlier, Asian markets fell after the release of the Chinese data.

Japan's Nikkei 225 index dropped 0.4 per cent, South Korea's Kospi lost 0.3 per cent and Kong's Hang Seng fell 0.5 per cent.

But mainland Chinese stocks took a smaller hit, with the poor trade numbers also raising hopes that China's leaders would take steps to ease policy measures to boost demand. The benchmark Shanghai Composite Index was almost unchanged, gaining less than 0.1 per cent.