Two Laptop Bag*
The moose likes JDBC and the fly likes connectio null problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "connectio null problem" Watch "connectio null problem" New topic
Author

connectio null problem

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
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

Joined: Apr 14, 2004
Posts: 10336



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.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
this is the error
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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

Joined: Jan 08, 2010
Posts: 510
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

You probably need a stackTrace in getConnection method in MyConnection class to know the reason.


Swastik
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
Thanks.
I didn't add the mysql connector jar.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connectio null problem
 
Similar Threads
File IO with Servlet
After UPDATE Statement, Null Value is fetched
error to login page
user authentication and dao
Servlet Displays Old DB Entries