• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 41878
909
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: 41878
909
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic