Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> apache/tomcat oracle jdbc connection
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 simpleHTML page
try { Class.forName("oracle.jdbc.driver.OracleDriver"); conn =
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,