Hello,

  I have a problem for creating a simple database connection with JSP,
tomcat 4.0.4, jdk1.4. I set the oracle jdbc driver ( class111,zip,
class12.zip, ojdbc14.jar) in the classpath.  Tomcat still complaint the
driver is not found. Here is the error that I got. Does anybody know I need
to configure something in the tomcat?

 

Thank you

 

org.apache.jasper.JasperException: Unable to compile class for JSPNote:
sun.tools.javac.Main has been deprecated.
 
 
An error occurred between lines: 35 and 58 in the jsp file:
/JSP/com/imedge/admin/test.jsp
 
Generated servlet error:
C:\Tomcat
4.0\work\Standalone\localhost\_\JSP\com\imedge\admin\test$jsp.java:101:
Class oracle.jdbc.driver.OracleDriver not found.
                    DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());
                                                                       ^
1 error, 1 warning
 
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
        at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:176)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:188)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        
 
Here is my source code:
 

<!-- Developed and Documented by Krishna Veeramachaneni -->

<html>

 

<head>

<title>IMEDGE Content Management Services Administrator</title>

<link href="/JSP/com/imedge/admin/style.css" rel="stylesheet"
type="text/css" >

<script language="JavaScript"
src="/JSP/com/imedge/admin/validation.js"></script>

<script language="JavaScript"
src="/JSP/com/imedge/admin/CascadeMenu.js"></script>

<script language = "JavaScript">

 

<!-- hide me

 

 

// show me -->

 

</script>

</head>

<% 

       

      /* Java code to retrieve family name and description if any */

      

 

      

%>

<body  link="#990000" vlink="#009999" alink="#009999"  

ID="Bdy" leftmargin="0" rightmargin="0" topmargin="0" bgcolor="beige" >

 

<%@ include file="/JSP/com/imedge/admin/Banner.jsp" %>

<%@ include file="/JSP/com/imedge/admin/FamilyMenu.jsp"%>

 

<%@ page import="javax.servlet.*" %>

<%@ page import="java.sql.*" %>

 

 

<% 

       

      /* Java code to retrieve family name and description if any */

 

    // Load the Oracle JDBC driver

    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

 

        Connection conn =

      DriverManager.getConnection ("jdbc:oracle:thin:@sunlab2:1521:chcity",

                           "xyzz", "xyzxc");

 

    // Create a Statement

    Statement stmt = conn.createStatement ();

 

    // Select the ENAME column from the EMP table

    ResultSet rset = stmt.executeQuery ("select table_name from
user_tables");

 

    // Iterate through the result and print the employee names

    while (rset.next ())

      System.out.println (rset.getString (1));

      

 

      

%>

            

 

</body>

 

</html>

 

 

Eddie Liang

Reply via email to