• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

query problem

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
The human mind is a dangerous plaything. This tiny ad is pretty safe:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic