This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Doubt about native query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Doubt about native query" Watch "Doubt about native query" New topic
Author

Doubt about native query

Victor Maehira
Ranch Hand

Joined: Mar 08, 2007
Posts: 35
Good afternoon!
I�ve downloaded the o'reilly ejb 3.0 book's example code. I was running the source code related to native sql queries when I got a ClassCastException. The snippet source code is the following :

Cruise Entity:


Query call:

(The same code can be found on page 623 and 624 of o'reilly book)

The ClassCastException happens in:


If the result�s index is changed, the application works correctly.



How can I justify it?
Thanks in advance!
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Cruise comes first, so as you said, it should be result[0], not result[1].


[My Blog]
All roads lead to JavaRanch
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Doubt about native query
 
It's not a secret anymore!