This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Extract output of CreateNativeQuery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Extract output of CreateNativeQuery" Watch "Extract output of CreateNativeQuery" New topic
Author

Extract output of CreateNativeQuery

Juliana Steven
Greenhorn

Joined: Nov 08, 2009
Posts: 6
Hi,

I am working on a piece of code where the sql statement returns 2 fields. For e.g.


Now resultList is comprised of Objects. Each Object has 2 attributes namely the ids which show up on Debug as BigDecimal or type Object. I tried giving a

to access the attributes, but am unable to do so.
How do I get the value of a.id and b.id in 2 separate variables from the Object result?

Any help would be appreciated.

Thanks Much,
Juliana
Juliana Steven
Greenhorn

Joined: Nov 08, 2009
Posts: 6
I figured it out. This is what I needed to do in the for loop



Now I can access my elements!
 
jQuery in Action, 3rd edition
 
subject: Extract output of CreateNativeQuery
 
It's not a secret anymore!