Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Oracle,JDBC and Servlets (JRun) How to tell the servlet where the drivers are ?

Oracle,JDBC and Servlets (JRun) How to tell the servlet where the drivers are ?

From: Mike Ryan <mryan_at_blue.ocn.ne.jp>
Date: Fri, 17 Apr 1998 20:12:52 +0900
Message-ID: <35373934.A7C82F36@blue.ocn.ne.jp>


Help (Solaris 2.6, Oracle 8, Thiun JDBC, JRun 2.4beta)

I get the following output from the below code when I try to connect to ORACLC using JRun, Solaris and JDBC

(1)ClassNotFound :null (2)SQLException : No suitable driver

    public void doGet (HttpServletRequest req, HttpServletResponse res)

        throws ServletException, IOException     {

        ServletOutputStream out = res.getOutputStream();
        res.setContentType("text/html");
        out.println("<html>");
        out.println("<head><title>Servlet</title></head>");
        out.println("<body>");
        try{
                Class.forName ("oracle.jdbc.driver.OracleDriver");

}
catch (ClassNotFoundException e) { out.println("(1)ClassNotFound :"+e.getMessage());
}
try{ Connection conn =DriverManager.getConnection ("jdbc:oracle:thin:@111.111.111.111.111:1521:orcl", "user", "pass"); Statement stmt = conn.createStatement (); ResultSet rset = stmt.executeQuery ("select MEMBER_NAME from MEMBERS"); while (rset.next ()){ out.println (rset.getString (1)); }
}
catch (SQLException e) { out.println("(2)SQLException : "+e.getMessage());
}

I know that the error is because the oracle.jdbc.driver.OracleDriver cannot be found. This code works when it is used in an applet or application. How can I tell JRun where to locate the drivers !! This is a showstopper and I would be greatfull for some help. There is a userclasspath in java.profiles but setting that has no effect. help help help !

Mike.



Mike Ryan,
TNF Lab.,
416 SoftTown Aoyama,Jingumae,                Tel: 81-3-5413-7235
Shibuya,Tokyo.                               Fax: 81-3-5413-7236
Japan. Received on Fri Apr 17 1998 - 06:12:52 CDT

Original text of this message

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