Hi,
    I didn't see your code, You have to set the classpath for Apache Server also 
(which points to JDBC driver
classes). Hope this helps you.

Regards Nitin.

Spencer Tasker wrote:

> Hi,
>
> I have written a sample simple servlet (with doPost method - since I would
> want to pass a parameter back from a form in the real version of the
> servlet) which is supposed to use JDBC to access an oracle database and pull
> back a bit of data. Unfortunately, it fails to work, telling me that it
> cannot find the JDBC driver, failing on the line
>
>         Class.forName("oracle.jdbc.driver.OracleDriver");
>
> Full error messages follow�at end of message.
>
> When I rewrite this simple servlet as an application it runs 100% OK.
>
> I have attached the 2 servlet & application source files in case anyone is
> interested, but I'm lost as to why I can't get hold of the database from the
> servlet. This must be a common situation, but I haven't found it mentioned
> anywhere.
>
> For what its worth I'm running Apache Jserv.
>
> Thanks in advance,
> - Spencer
>
> ERROR MESSAGES--------------------------------
> Unable to load JDBC driverException: null        <<< from my code
> java.sql.SQLException: No suitable driver
>  at java.sql.DriverManager.getConnection(DriverManager.java:111)
>  at java.sql.DriverManager.getConnection(DriverManager.java:149)
>  at dbtestServlet.doPost(dbtestServlet.java:52)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:521)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
>  at org.apache.jserv.JServConnection.run(JServConnection.java:359)
>  at java.lang.Thread.run(Thread.java)
> Unable to read derivation: No suitable driver    <<< from my code
>
>   ------------------------------------------------------------------------
>                      Name: dbtestapp.java
>    dbtestapp.java    Type: Visual Cafe File 
>(application/x-unknown-content-type-VisualCafeFile.Document)
>                  Encoding: quoted-printable
>
>                       Name: dbtestserv.java
>    dbtestserv.java    Type: Visual Cafe File 
>(application/x-unknown-content-type-VisualCafeFile.Document)
>                   Encoding: quoted-printable

___________________________________________________________________________
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