This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deployed App not connecting to Database

 
Sara Tracy
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using this code to connect to an Oracle databse


When I run this program on my local machine, it works fine, and gets me the result.

However when I deploy this application, and call a servlet (Say X) accessing this class (say Y), it throws an internal server error, and displays "connection close"

Now in class 'Y', even if I'm not calling the method (having the above database connection code), it still throws the error ! Only if I have this code commented, then the rest of the deployed application works properly without any errors.

Any suggestions appreciated.
 
Naseem Khan
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do SOP for all the objects. Check for which object you are getting null..

System.out.println("Connection object>>>>>" + conn);
System.out.println("Statement object>>>>>" + stmt);
System.out.println("ResultSet object>>>>>" + rset);

Second thing,

Can you show us the stacktrace of the thread?


Thanks


Naseem
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic