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

dbtestapp.java

dbtestserv.java

Reply via email to