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

apache/tomcat oracle jdbc connection

From: Dave Beebe <dave_beebe_at_yahoo.com>
Date: 16 Sep 2002 11:47:52 -0700
Message-ID: <9cc2e645.0209161047.7cc85c04@posting.google.com>


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,

Received on Mon Sep 16 2002 - 13:47:52 CDT

Original text of this message

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