Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connectio null problem

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my jsp class


this is my servlet part of code


this is my connection class


But is prints Coeection is null
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Your code seems to be written in a way to be deliberately unhelpful! Exception stack traces contain a wealth of information about what is going wrong. Print the stack trace - you should get an idea what could be happening.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the error
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, though that stack trace certainly looks bad it is not comming from your connection code. Did you print the stack trace from there?
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Swastik Dey
Rancher
Posts: 1602
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably need a stackTrace in getConnection method in MyConnection class to know the reason.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
I didn't add the mysql connector jar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic