• Post Reply 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

J2EE server not connecting to database

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author & internet detective
Posts: 42154
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 42154
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nirmal,
Glad to hear it is working. Thanks for sharing the solution with us.
reply
    Bookmark Topic Watch Topic
  • New Topic