File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

customerDAO returning NPE error

 
Charles Sexton
Ranch Hand
Posts: 237
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am relatively new to the data access object structure, which can be found here http://www.oracle.com/technetwork/java/dataaccessobject-138824.html. I am pretty sure that I am doing something wrong. I am trying to get the application running incrementally so the app doesn't really do much except get first name and last name of user input and then uses the database to retrieve that particular customer details. Here is the error that I am receiving and the code is below that. I also apologize for the bad formatting in the code. I don't normally format till I have a completed application but am learning to do it as I go as it reduces time by not having to go back through the code.





This class is in the customer class which basically gets the user input from the web page and sends the request back. Didn't post all the code because mostly getters and setter plus variable initialization.





Database connection class



customerDataAccessObject Class

 
Charles Sexton
Ranch Hand
Posts: 237
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have also tried it a different way but it returns the same NPE error.




Here is what I changed from the data access object. I included the whole customer class in case something is in correct.






 
Charles Sexton
Ranch Hand
Posts: 237
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also here is the webpage

incase if anyone needs

 
Charles Sexton
Ranch Hand
Posts: 237
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was a little more complicated than a NPE, but solved it on my own. Actually had to re-install netbeans and MySQL. Then changed quite a bit of code after a few hours of research and it worked great......Just wanted to add this to reply incase anyone looks at the thread
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic