• 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

Writing CSV File from Database Generates Null Pointer

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone. I am using the code below to write the contents of a SQL database to a CSV file. However, every time I run it, regardless of the database content, I get a null pointer error somewhere in a record in the 800s range (and the file write stops). Since it produces the same error with different data, I'm pretty sure that the problem is not in the database content. Can you take a look and see if you have any ideas? Thanks!

 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Run it again, and this time look carefully at the stack trace. It will tell you the line number where the error occurs. Look there.

However, having said that, if you are going to test whether MainMenu.rs is null, surely you should do that before this line of code:
 
Scott Florez
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This line is causing the null pointer:



Also, the null pointer is not always in a record in the 800s range, as I just produced the error in the 500s range.
[ April 10, 2007: Message edited by: Scott Florez ]
reply
    Bookmark Topic Watch Topic
  • New Topic