Check to make sure the servlet is running in a particular NT account, or
that the ODBC data source is a system DSN, and not a user DSN. Either way,
remember that services (which most web servers are) can and often do run in
a separate NT account than when executed from the command-line of a
logged-in process.

If you're not sure, check the account for the Web server, and temporarily
switch it to your own; then try the servlet again (probably have to
reboot--service settings aren't reread until bootup). If it's this, the
servlet should work fine.

It's possible that the DB2 install reinstalled some ODBC components, or else
that during your removal of the DB2 installation you accidentally erased
some DSNs and had to set them up again, and did so under a different account
or something.

HTH; it's not exactly the world's most scientific answer.

Ted Neward
Patterns/C++/Java/CORBA/EJB/COM-DCOM spoken here
http://www.javageeks.com/~tneward
 "I don't even speak for myself; my wife won't let me." --Me

-----Original Message-----
From: Takyiu Liu <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, July 14, 1999 4:49 PM
Subject: jdbc-odbc calls work only in applications but not in servlets


>        I have the strangest error, and I have literally tried
>everything with not much luck, so here I am, completely humble, asking
>for help from this group.
>        I have been doing database access (a SQL Anywhere DB) through a
>multitude of servlets for more than a year now.  I use JDBC-ODBC
>bridge, and I set up the Sybase DB through the ODBC administrator on my
>NT workstation.  I have a new PC, with service pack 4 installed.  I
>setup my DB, configured my Sybase DB to use the Sybase ODBC driver with
>the ODBC administrator, copied my servlets to the servlets folder in
>the JRun (version 2.3.2) engine, (I used their default web server: I
>did not use their connector) and was happy serving my servlets to my
>colleagues through a golbal connection pool (using Javaexchange's
>DBConnectionBroker).  That was 2 days ago.
>        Then I started playing with IBM's DB2 Universal Database.  After
>installing their demo, I realized it somehow corrupted my ODBC setup,
>and everytime I tried to use a JDBC-ODBC bridge a dialog box came up
>warning me that my resource dll odbcint.dll is of a different version
>than my odbccp32.dll, and that I am supposed to reinstall my core ODBC
>components.  After a few hours of searching on the web, I realized I
>can download a file called mdac_typ.exe (I picked version 2.1) from
>Microsoft and I reinstalled my core ODBC components.
>        The only problem is: now my Java APPLICATIONS can use jdbc-odbc
>bridge.  No problem, no warning whatsoever.  But my SERVLETS's init()
>function (where I create a pool of DB connections) would scream "Error
>code: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data
>source name not found and no default driver specified" error at me
>consistently.
>        My question is: why?  Why would a servlet's init() behave any
>differently than a Java application's member function?  I have never
>seen anything like this, nor can anyone gives me any explanation.  I
>have written some other programs to access the same database with an
>RMI server or a socket server through a jdbc-odbc bridge, they still
>all work.  EXCEPT my darnest servlets.  None of them works.  So, if
>anyone can shed some light and point me in the right direction, I will
>be most grateful.
>        Best regards, Takyiu Liu
>
>_________________________________________________________
>Do You Yahoo!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to