• 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

JDBC ODBC Connection

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am developing a web application using Netbeans. I use jdbc odbc connection to connect to a database which is on another server. The database server is SQL 2008 Professional. My program runs fine when I run it from Netbeans. The problem comes when it is deployed. The database connection fails and an exeception is thrown. I use Tomcat 6 for deployment. I checked it again and again and it was very surprising for me to see the same program running from Netbeans but fail when it is deployed. Can anyone please help me.

By the way, this is my first post on coderanch Excited!

Regards,

Hemen
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hemen, welcome to JR.
Please post the log you got when app tried to connect to the remote db host.
 
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it works fine from Netbeans, mostly your issue must be regarding a classpath jar missing.
Since you are deploying your app in tomcat, can you verify if you have all your required JAR files either in "<Tomcat>\lib"

OR

<Tomcat>\webapps\<your_app>\lib

folders ?
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't use the JDBC-ODBC driver. It's not intended for multi-threaded systems such as web appservers. In fact, it's not intended to be used at all except as a last resource.

There are several SQL Server-specific JDBC drivers from Microsoft and other sources. In fact, there's one on SourceForge.net that's more reliable than the one from Microsoft. I learned about it when I was having transaction issues using the MS driver.
 
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic