This week's book giveaway is in the General Computing forum.
We're giving away four copies of Learning Regular Expressions and have Ben Forta on-line!
See this thread for details.
Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

query problem  RSS feed

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my jsp, I'm trying to pull data from a MS SqlServer 2000 db.I have a panelists table and a survey table. Panelists primary=record_id, which relates to panelist_id in the survey table. I want to pull data for panelists who have yet to complete a survey(i.e. panelists.record_id != surveys.panelist_id). I'm getting a null pointer exception. When I do a query for panelists who have completed a survey(i.e. panelist.record_id=surveys.panelist_id), the dataset comes back fine.
I'm new to programming, and I realize this doesn't relate too much to jdbc, but any advice will be greatly appreciated.
[ June 28, 2004: Message edited by: Bill Brasskey ]
 
Ranch Hand
Posts: 382
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not knowing how you have written your sql & your jsp makes it rather difficult to determine the cause of the NPE. Look at the stack trace; it will tell you which line of code generated the NPE. Then look at that line # in the .java file that would have been generated from your jsp and try to determine the reason for the NPE.

Are you using a minus query to get the appropriate result set?
select col1, ... from table 1
minus select col2, ... from table 2

Or you can use something like this:
select col1,... from table 1 where id not in (select id from table 2)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!