This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing CSV File from Database Generates Null Pointer

 
Scott Florez
Ranch Hand
Posts: 58
  • 0
  • 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
Pie
Posts: 20177
25
MySQL Database
  • 0
  • 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
  • 0
  • 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 ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic