Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Trouble connecting to Oracle from Tomcat using JNDI
Kiran wrote:
> Hi,
> I am using Tomcat5 and Oracle 9i and having trouble trying to connect
> to my database using JNDI.
>
[...]
> <parameter>
> <name>url</name>
> <value>jdbc:oracle:thin_at_127.0.0.1:1521:costanza</value>
[...]
> The SID of my database is costanza and I am able to connect to it
> using DriverManager. But when I use JNDI, I get the following error.
>
> org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver
> of class '' for connect URL 'null', cause: No suitable driver
>
> I am struggling to solve this problem. Can anyone please help?
>
> Thanks in advance.
> -Kiran
It might be as simple as a missing colon.
According to the docs,
"jdbc:oracle:thin:@HOST:1521:SID"
Note the colon between "thin" and "@".
For the future, you might also want to consider migrating to the more modern SERVICE_NAME rather than the SID format. Something like this:
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=costanza.xxx)))
For this to work, your RDBMS instance and/or listener.ora needs to have several value set properly.
--Mark Bole Received on Tue Feb 10 2004 - 19:56:59 CST
![]() |
![]() |