Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Trouble connecting to Oracle from Tomcat using JNDI

Re: Trouble connecting to Oracle from Tomcat using JNDI

From: Mark Bole <makbo_at_pacbell.net>
Date: Wed, 11 Feb 2004 01:56:59 GMT
Message-ID: <LZfWb.22418$%w4.11895@newssvr27.news.prodigy.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US