Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
    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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Getting error when trying DB methods...  RSS feed

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
I hope I have posted this in the right forum category. I am getting this error (below) when trying to create two simple methods. Is there anything wrong with my methods or with my connection? Please explain it to me like I am five years old because I don't have much experience using Java with MySQL.


Exception in thread "main" Connection failed....
java.lang.NullPointerException
at com.company.DB_Connection.getEmployeesName(DB_Connection.java:23)
at com.company.Main.main(Main.java:8)

Process finished with exit code 1

 
Sheriff
Posts: 13155
219
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question to multiple forums.  Locking this topic.  Continue discussing here: https://coderanch.com/t/704555/databases/connection-error-Beginner
 
Then YOU must do the pig's work! Read this tiny ad. READ IT!
Become a Java guru with IntelliJ IDEA
https://www.jetbrains.com/idea/
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!