• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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)
Hey! Wanna see my flashlight? It looks like this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!