Hi,
I am currently using Tomcat4.0 and jdk1.3 and my system is Windows
2000. I setup everything and it works fine. However, when I try
to run one of my servlets (a servlet that will connect to odbc
database). Pls take a look at
my CLASSPATH and servelt, let me know if I am missing something. Thanks
much.
I got the error complaining about the driver which is "SQLException
caught: No suitable driver"
Here is my CLASSPATH:
CLASSPATH= C:\tomcat4.0\jakarta-tomcat-4.0\bin\servlet.jar;
C:\jdk1.3\jre\lib\rt.jar
And here is my java code:
/*
VideoSelectServlet
*/
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
/**
* This is a simple example of an HTTP Servlet. It responds to the GET
* method of the HTTP protocol.
**/
public class VideoSelectServlet extends HttpServlet {
public void doGet (HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc.odbc.Movie Catalog";
con = DriverManager.getConnection (url, "", "");
System.out.println("Testpoint");
}
catch (ClassNotFoundException e) {
System.out.println("SQLException caught: " + e.getMessage());
}
catch (SQLException e) {
System.out.println("SQLException caught: " + e.getMessage());
}
finally {
try {
if (con != null) con.close();
}
catch (SQLException ignored) {}
}
}
public String getServletInfo() {
return "The BookDetail servlet returns information about" +
"any book that is available from the bookstore.";
}
}
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets