----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
> > And I am getting
> > SQLException: No suitable driver
> > getSQLState: 08001
> > getErrorCode : 0
> >
> > The same connection code when it is not run under Jserv works
> > correctly.
I have run in to this. It was very weird. Here is what solved it for
me, and my explanation (which is quite tentative):
Instead of the line of code that they always tell you to use to load
the driver:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
do this:
Driver d = null; // class variable
//.... later in some class method
{ // ....
Class c = Class.forName(driverClassString);
driver = (Driver)c.newInstance());
// ...
}
It seems (someone else might have a better explanation) that the
loaded driver class gets garbage collected or something. I don't
know. It shouldn't. But the above code made the problem go away.
hope this helps: please let me know if it does.
-glen
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]