This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes ReportMatrix Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "ReportMatrix" Watch "ReportMatrix" New topic


shumani edzani

Joined: Oct 03, 2008
Posts: 9
My sql is like this and it gives me an nullPointerException what might be the problem please help

select org.orgName,appraisal.appraiser, appraisal.appraisee, as deptname
from org, staticdata, hruser, appraisal
where = hruser.deptname
and hruser.userid = appraisal.appraisee
group by hruser.deptname
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38412
Welcome to JavaRanch

At a quick � second look at your SQL I can't see a problem with it; I presume it runs all right from the command line? A NullPointerException (NPE) doesn't occur in SQL code at all; it occurs in the Java code which you haven't provided. Go to the beginner's forum and do a search for NullPointerException and you find threads like this one, which has links to older threads. Go through them and you will know more about NPEs, to help you solve your present problem.
Rob Spoor

Joined: Oct 27, 2005
Posts: 19672

I agree with Campbell - this problem is not caused by SQL.

Also, NPEs are more of a beginner's problem (although even experienced programmers can be haunted by them ).
Moving there.

How To Ask Questions How To Answer Questions
subject: ReportMatrix