This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NoResultException

 
Ismael Gimenez
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, im having trouble with the code listed below.



When i the system execute the code it returns null insted of throwing an exception.

I donno why.
 
Vijitha Kumara
Bartender
Posts: 3953
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked the generated query in this case? What id returns if executed directly against the DB?
 
Ismael Gimenez
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijitha, thanks for the response.

A few days ago i realized that I was somehow wrong, since the query did find results. That is to say, it finds a result in the DB with the name pass as parameter and the query returns a property of that result that it turns out to be null.
Therefore, it finds a result that is null, that is different to not finding a result at all.

Anyway, thanks for your time!

Cheers!
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!