Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

J2EE server not connecting to database

 
Nirmal JeyaChandra
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The above is my code which works using Tomcat Server, but while using J2EE server it gives error message as client code at null in the command prompt.
Please help me. Thank you in advace.

Nirmal Jeya Chandra

[edited to add code tags]
[ October 09, 2005: Message edited by: Jeanne Boyarsky ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nirmal,
Welcome to JavaRanch!

What error message are you getting in the logs? I suspect it is a classpath issue if it works in one server and not another. Double check the JDBC driver is in your classpath.

I recommend changing the code to do everything in one try/catch block. If you can't load the driver, do you really want to attempt a database connection? This leads to confusing error messages.
 
Nirmal JeyaChandra
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for your reply.

Actually, I did not place the class file, which has the JDBC statements in the j22ee/lib/classes folder. This was the mistake.

Now I got the database connectivity. Everything is working fine.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nirmal,
Glad to hear it is working. Thanks for sharing the solution with us.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic