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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Getting error when trying DB methods...  RSS feed

 
Greenhorn
Posts: 21
  • 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: 12815
211
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
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!