Add your JDBC classes to ServletExec's JVM. You can do this by going
"ServletExec Admin" screen, click on "VM Settings" and add JDBC classes to
the ClassPath.

Hope this helps.

Giri





"Pernice, Tommaso" <[EMAIL PROTECTED]>@JAVA.SUN.COM> on 12/13/99
09:00:49 AM

Please respond to "A mailing list for discussion about Sun Microsystem's
      Java Servlet API Technology." <[EMAIL PROTECTED]>

Sent by:  "A mailing list for discussion about Sun Microsystem's Java
      Servlet API Technology." <[EMAIL PROTECTED]>


To:   [EMAIL PROTECTED]
cc:

Subject:  jdbc and servlets problem


I am trying to run a servlet with ServletExec which access a database
through JDBC.
While the servlet works fine in the Visual Cafe' environment, when I run it
through ServletExec I get the "No suitable driver" error. I tried every
suggestion I found on the web, but nothing did work. Here's the very simple
code (without the exception handling code):

-------------------------------------------------------------------------
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
con = drv.getConnection("jdbc:odbc:test");
stm = con.createStatement();
rds = stm.executeQuery("Select * From Contacts Order By Lastname");

while (rds.next()) {
        String q = rds.getString("FirstName");
      String n = rds.getString("Lastname");
      out.println("<LI>"+ q + "   /" + n + "</LI>");
        }

rds.close();
stm.close();
con.close();

----------------------------------------------------------------------------

-

Thanks

Tom

___________________________________________________________________________
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