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: apache/tomcat oracle jdbc connection

Re: apache/tomcat oracle jdbc connection

From: unknown <nobody_at_blackhole.nospam.com>
Date: Mon, 16 Sep 2002 22:52:55 +0200
Message-ID: <pan.2002.09.16.20.52.52.186273.1809@blackhole.nospam.com>


On Mon, 16 Sep 2002 20:47:52 +0200, Dave Beebe wrote:

> Hi everyone,
>
> I've been trying for serval days now to get a very simple servlet to
> connect to an oracle 8.0.5 database. I have seen other posts similar to
> this and have tried what they have recommended without success.
>
> Here is the current details:
>
> Redhat (kernel 2.4.18) on a dual celeron system (running SMP kernel)
> Oracle 8.0.5
> 1.3.1.04 JDK (from sun)
> Tomcat 4.1.10
> Apache 1.3.22
> classes12.jar (thin driver from Oracle: said it would work with JDK's
> 1.2 & 1.3)
>
> I had it working at one time, but then upgraded tomcat, apache and the
> JDK, now I can't seem to get it to connect. I keep getting a "Invalid
> Oracle URL specified" error from the getConnection method. The servlet
> is unchanged from the time it worked.
>
> Here is the code where the failure is occuring:

>>>>>>>

> import java.io.*;
> import java.sql.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
>
> public class FirstServlet extends HttpServlet {
> Connection conn = null;
> Statement stmt = null;
> ResultSet rs = null;
>
> // The doGet function provides the functionality of // a servlet.
> public void doGet(HttpServletRequest request, HttpServletResponse
> response)
> throws IOException, ServletException
> {
> PrintWriter out = response.getWriter();
> response.setContentType("text/html"); // Generate a simple
> HTML page
>
> try {
> Class.forName("oracle.jdbc.driver.OracleDriver"); conn =
> DriverManager.getConnection("jdbc:oracle:thin_at_LCO1:1521:SB01","xxx","yyy");
> ...
> ...
> <<<<<
>
> The servlet compiles fine. The driver registers fine, I made sure the
> classes12.jar was in the CLASSPATH. But I cannot manage to get it past
> the getConnection, without the Invalid URL error. I can connect via
> sqlplus, locally and remotely, plus through Toad remotely, so I don't
> think it has anything to do with the database setup. I have verified
> that the port is correct on the connection string (which was the same as
> when it was working).
>
> At this point I seem to think it has something to do with the drivers
> and possibly the combination of tomcat/apache/jdk versions? But have
> found no mentions here, at Oracle or a couple other mini FAQ's I've
> checked that seem to mention any incompatibilities specifically.
>
> Any help is greatly appreciated.
>
> Thanks in advance,
>
> - dave
 

Which exception is thrown and what does it's printStackTrace() method say?

Does your code work with a less ancient version of the database?

-- 
Cheers, 

dmz17 --- If I had an Xbox it would run Linux ---
Received on Mon Sep 16 2002 - 15:52:55 CDT

Original text of this message

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