File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Extract output of CreateNativeQuery" Watch "Extract output of CreateNativeQuery" New topic

Extract output of CreateNativeQuery

Juliana Steven

Joined: Nov 08, 2009
Posts: 6

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 and in 2 separate variables from the Object result?

Any help would be appreciated.

Thanks Much,
Juliana Steven

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!
I agree. Here's the link:
subject: Extract output of CreateNativeQuery
Similar Threads
NamedQuery: Retrieve more than one field?!?
how can i join two different table
JOIN syntax for HQL . Need help!
bind variable does not exist
How to handle a list in JSF 2