Interestingly, Java interfaces just fine with Access. Here is a sample
JSP which calls a Java Bean that uses Access:
<html>
<head>
<title>Insert Records</title>
</head>
<%@ page import="java.sql.*" %>
<body>
<h2>asdkjasdflkj</h2>
<jsp:setProperty name="updateUser" property="dsn" value="<%=
application.getRealPath("/mydb.mdb") %>" />
<br>
</body>
</html>
package project2; //java bean
import java.util.*;
import java.net.*;
import java.io.*;
import java.sql.*;
public class SqlBean2 implements Serializable
{
private String dsn = "jdbc:odbc:;DRIVER=Microsoft Access Driver
(*.mdb);DBQ=";
private String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
public void setDsn(String dsn){this.dsn = this.dsn + dsn;}
public String AddRec()
{
try
{
Class.forName(this.driver);
Connection con;
con = DriverManager.getConnection(this.dsn);
Statement Stmt = con.createStatement();
Stmt.executeUpdate("Insert Into tblmydb(Name) Values('Bill')");
con.close();
}
catch(Exception e){return "ERROR: " + e;}
return "";
}
}
I could get into this more, but hey, it's an Access NG :). Just giving
you an idea how you could use Access with Apache Tomcat or Resin. Note:
this sample doesn't display anything on the webpage, just adds a record
to an Access mdb from a jsp webpage. But you get the idea.
Rich
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!