Last time I checked, the Oracle driver was named
oracle.jdbc.driver.OracleDriver.
    (*Chris*)

----- Original Message -----
From: "Manoj Kithany" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 25, 2002 11:03 AM
Subject: Re: [SERVLET-INTEREST] simplest Servlet-JDBC not working


> Hi Friends,
>
> THANKS for sharing your thoughts on my problmes.
>
> I tried to run my Servlet-JDBC from Browser also on which I get following
> Error at my command console - wonder why.
> ----------------------------------------------------------------
> 11:53:15,713 INFO  [MainDeployer] Successfully completed deployment of
> package: file:/jboss-3.0.0_tomcat-4.0.3/server/default/deploy/ki
> thany.war
> 11:53:22,531 INFO  [Engine] DBServlet: init
> 11:53:22,562 ERROR [STDERR] java.lang.ClassNotFoundException:
> oracle.jdbc.OracleDriver
> ---------------------------------------------------------------
>
> As mentioned earlier, I have my App Server and DB Servere on DIFFERENT
> machines. I have loadede my JDBC Drivers (both ZIP and JAR) on my App.
> Server and have included them in CLASSPATH as well.
>
> Any relevanet infor. on this is appreciated.
>
> THANKS EXPERTS.
>
> Manoj G. Kithany
>
> >From: Chris Pratt <[EMAIL PROTECTED]>
> >Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> >         Servlet API Technology." <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: simplest Servlet-JDBC not working
> >Date: Wed, 25 Sep 2002 10:53:29 -0700
> >
> >You can do it, but it's a royal pain.  You have to create dummy
> >HttpServletRequest and HttpServletResponse objects to pass into doGet or
> >doPost, which is a big job just to be able to run it from the command
line.
> >   (*Chris*)
> >
> >----- Original Message -----
> >From: "Mike Marchywka" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Wednesday, September 25, 2002 10:45 AM
> >Subject: Re: [SERVLET-INTEREST] simplest Servlet-JDBC not working
> >
> >
> >It can be nice to ADD a main to a derived class - for testing from a more
> >controlled
> >environment. I've never tried this with a servlet but it works for
applets.
> >You could even create a debug super class I guess.
> >
> >
> > > -----Original Message-----
> > > From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, September 25, 2002 12:58 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: simplest Servlet-JDBC not working
> > >
> > >
> > > Yeah, and he's calling super.init( config ) too.
> > >
> > > -----Original Message-----
> > > From: Chris Pratt [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, September 25, 2002 12:44 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: simplest Servlet-JDBC not working
> > >
> > >
> > > It's a servlet, it doesn't have a main(), so you can't run it
> > > using the java
> > > command at the command line.  You have to run it under a
> > > Servlet Engine.
> > >   (*Chris*)
> > >
> > > ----- Original Message -----
> > > From: "Manoj Kithany" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, September 25, 2002 9:32 AM
> > > Subject: [SERVLET-INTEREST] simplest Servlet-JDBC not working
> > >
> > >
> > > > hi,
> > > >
> > > > i am having simplest of Servlet program (DBServlet.java)
> > > which is trying
> > > to
> > > > connect to my ORCL DB.
> > > >
> > > > My Application and DB Server are on different machines. I
> > > am having my
> > > JDBC
> > > > Drivers (in ZIP format) on my App Server installed with CLASSPATH.
> > > >
> > > > when I try to run i get below errors:
> > > > # java DBServlet
> > > > Exception in thread "main" java.lang.NoSuchMethodError: main
> > > > #
> > > >
> > > > import java.io.*;
> > > > import java.sql.*;
> > > > import javax.servlet.*;
> > > > import javax.servlet.http.*;
> > > >
> > > > public class DBServlet extends HttpServlet {
> > > >
> > > > private Connection con;
> > > > private PrintWriter out;
> > > > private String url = "jdbc:oracle:thin:@MY_IP_ADDRESS:1521:MY_SID";
> > > >
> > > >
> > > > public void init(ServletConfig conf)
> > > >         throws ServletException {
> > > >     super.init(conf);
> > > >     try{
> > > >
> > > >        //Class.forName("oracle.jdbc.OracleDriver");
> > > >        //con =DriverManager.getConnection(url, "scott", "tiger");
> > > >     }catch(Exception e) {
> > > >             System.err.println(e);
> > > >     }
> > > > }
> > > >
> > > > public void service(HttpServletRequest req, HttpServletResponse res)
> > > >     throws ServletException, IOException {
> > > >     res.setContentType("text/html");
> > > >     try {
> > > >         out = res.getWriter();
> > > >         out.println("<html>");
> > > >         out.println("<head>");
> > > >         out.println("<title> Sample JDBC Servlet Demo" +
> > > "</title>");
> > > >         out.println("</head>");
> > > >         out.println("<body>");
> > > >
> > > >         Class.forName("oracle.jdbc.OracleDriver");
> > > >         con =DriverManager.getConnection(url, "scott", "tiger");
> > > >         Statement stmt = con.createStatement();
> > > >         ResultSet rs = stmt.executeQuery("select * from emp");
> > > >         out.println("<UL>");
> > > >         while(rs.next()) {
> > > >             out.println("<LI>" +  rs.getString("EName"));
> > > >         }
> > > >         out.println("</UL>");
> > > >         rs.close();
> > > >         stmt.close();
> > > >     } catch(Exception e) { System.err.println(e);    }
> > > >       out.println("</body>");
> > > >       out.println("</html>");
> > > >       out.close();
>
>
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to