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.sq l.*" %>
<body>
<h2>asdkjasdflk j</h2>
<jsp:setPropert y name="updateUse r" property="dsn" value="<%=
application.get RealPath("/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:;DRI VER=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(t his.driver);
Connection con;
con = DriverManager.g etConnection(th is.dsn);
Statement Stmt = con.createState ment();
Stmt.executeUpd ate("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!