• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing CSV File from Database Generates Null Pointer

 
Scott Florez
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • 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!

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic