> But I got an SQL exception.
>
> Can anyone give me some help. Thank you very much!
First, try reading
http://www.catb.org/~esr/faqs/smart-questions.html
and in particular, this section:
http://www.catb.org/~esr/faqs/smart-questions.html#beprecise
Now you'll understand why you're not likely to get a response to your
question unless you give us more information than "I got an SQL exception".
David Harper
Cambridge, England
"Long Nguyen via JavaKB.com" <forum@JavaKB.com> said:
>I am using Tomcat 5.5.7 and Oracle 8.1.6 on my computer (localhost). I am
>trying to connect to Oracle using JNDI follow the Tomcat Documentation.
[quoted text clipped - 5 lines]
>DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
>Connection conn = ds.getConnection();
This code snippet seems correct, so the problem is somewhere else:
- configuration of Oracle (mainly TNS listener config)
- configuration of Tomcat
- jndi resource configuration in server.xml
- jndi resource mapping to application in the application-specific
xml file (no, not the WEB-INF/web.xml, but the one in directory
tomcat/conf/Catalina/hostname/ )
- availability/installation of Oracle JDBC library
>But I got an SQL exception.
Well, there are quite a lot of them, and usually each of them can be
caused by numerous different failures (with the exact failure being
reported with the exception message). So, just "SQL exception" is of
no help.

Signature
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)