File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes JDBC ODBC Connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "JDBC ODBC Connection" Watch "JDBC ODBC Connection" New topic

JDBC ODBC Connection

Hemen Mersha

Joined: May 27, 2010
Posts: 1

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!


Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

Hemen, welcome to JR.
Please post the log you got when app tried to connect to the remote db host.

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Dawn Charangat
Ranch Hand

Joined: Apr 26, 2007
Posts: 249
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"



folders ?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

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 that's more reliable than the one from Microsoft. I learned about it when I was having transaction issues using the MS driver.

An IDE is no substitute for an Intelligent Developer.
subject: JDBC ODBC Connection
jQuery in Action, 3rd edition