The market for handheld computers may be staging a comeback, thanks in large part to Research In Motion ( RIMM), according to data released today by Gartner.

Handheld makers shipped 2.75 million personal digital assistants (PDAs) in the second quarter, up 12% from the same period a year ago, according to Gartner.

Research In Motion's shipments grew 289% to 510,000 units, making it the third-largest handheld maker in terms of volume. In terms of units, RIM's shipments increased by nearly 380,000 -- or about 1.3 times the total amount by which overall handheld shipments increased.

Gartner attributed RIM's success to growing business demand for handhelds.

"The second-quarter results show a continuing shift from what has been a predominantly consumer market to a market in which more than one-third of all PDA purchases are made by organizations," said Gartner analyst Todd Kort in a statement.

Hewlett-Packard ( HPQ) and Dell ( DELL) also gained share in the quarter, according to Gartner.

H-P, the No. 2 handheld maker in terms of volume, shipped 529,773 units in the quarter, up 38.9% from the second quarter last year. Meanwhile, Dell shipped 147,500 handhelds, up 6.5%. H-P's market share was 19.3% in the quarter, while Dell's was 5.4%.

Market share losers included PalmOne ( PLMO) and Sony ( SNE), according to Gartner. PalmOne's shipments declined 3.2% to 913,202, giving it a 33.2% share of the market.

Sony, which announced last month that it was exiting the PDA market, saw its shipments decline 35.9% to 174,804 units. The consumer electronics giant held a market share of 6.4% in the quarter, good enough for fourth place.

Gartner's data stands in contrast to research released earlier this week by IDC. IDC reported that handheld shipments declined 2.2% in the second quarter from the same period last year to 2.2 million units worldwide.

The difference between IDC's numbers and Gartner's figures largely has to do with how the two research firms classify RIM's Blackberry device, IDC analyst David Linsalata said. While Gartner categorizes the Blackberry as a handheld, IDC considers it to be a "converged" device, and doesn't include its shipments in its PDA totals, Linsalata said.

Despite Gartner's data indicating a sales decline, PalmOne's stock rose $3.37, or 9%, to $40.87 Thursday. H-P's stock was also trading higher, gaining 28 cents, or 1.4%, to $20.21.

Dell, RIM and Sony all traded lower: Dell fell 9 cents, or 0.3%, to $35.26; RIM slid 46 cents, or 0.7%, to $61.76, and Sony shed 76 cents, or 2.2%, to $34.27.