Help JSP connecting to Access

Giganews Newsgroups
Subject: Help JSP connecting to Access
Posted by:  pcma100… (Paul)
Date: 31 Jul 2003


I'm trying to connect to an Access database using tomcat. I'm new to
JSP so I'm not sure whether I'm doing the right thing. I'm saving the
code below as "AccessConnect.jsp" under
"jakarta-tomcat-4.0\webapps\jsptests\". Under the folder jsptests is
an empty subfolder called "WEB-INF". Under this folder are two empty
folders calles "lib" & "classes".

I then open I.E. and type the url
I'm getting page not found. Can someone tell me what am I doing wrong.
Am I supposed to compile something or Tomcat is supposed to do that
automatically? Thanks.

I also have the following variables setup on Windows 2000 NT:
CATALINA_HOME c:\jakarta-tomcat-4.0
CLASSPATH c:\jakarta-tomcat-4.0\common\lib\servlet.jar;.
JAVA_HOME c:\j2sdk1.4.1_01
BEM;C:\DMI\WIN32\BIN;C:\Documents and

Here's the code:

<%@ page import="java.sql.*" %>
<%@ page import="*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>


//instantiate variables
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String queryString;
queryString = "select COF_NAME, PRICE from COFFEES";

//Load the JDBC driver

//Get the connection getConnection("access driver", "userID",
con = DriverManager.getConnection("jdbc:odbc:AccessPaul","myUserID","myPassword");

stmt = con.createStatement();

//sql statements: create, update, query
rs = stmt.executeQuery(queryString);

while ( {
String result = rs.getString("name");

<%= result %> </br>

}catch (Exception e) {