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: Benjamin <bhofmann_at_oneok.com>
Date: 9 Mar 2004 06:31:35 -0800
Message-ID: <1537b346.0403090631.6fdaf6d3@posting.google.com>


I've spent the last couple of days familiarizing myself with the new 5.0.19, especially the JNDI connection pooling. I tried, unsuccessfully, to use the admin console to set up JDNI datasources as well as editing the xml files directly following the instructions in the documentation. I kept getting the error you mention, "Cannot create JDBC driver of class '' for connect URL 'null', cause: No suitable driver". The only way I was able to get the connection pooling to work was to manually create a context in the server.xml and add the resources there. This worked great. The documentation for Tomcat 5 looks suspiciously like the Tomcat 4 so I think it is not updated yet.

Ben

Mark Bole <makbo_at_pacbell.net> wrote in message news:<LZfWb.22418$%w4.11895_at_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 Mar 09 2004 - 08:31:35 CST

Original text of this message

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