Help coderanch get a
new server
by contributing to the fundraiser
  • 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

customerDAO returning NPE error

 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
also here is the webpage

incase if anyone needs

 
Charles Sexton
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic