请问怎么使用JSP连接ACCESS数据库
请问如何用JSP连接ACCESS数据库?
我用DREAMWEAVER连接数据源的时候老是说 "发生一个不知名的错误 ",怎么回事呢?
如果通过代码怎么连接?
我什么都不懂,该如何做,代码写在什么位置,请说的具体点好吗?谢谢大家了
------解决方案--------------------配ODBC,用JDBCODBC桥来连
------解决方案--------------------http://down3.tomore.com/down/datanew/2004120517300028989.rar
JSP通过JDBC驱动各种数据库方法
里面包含了,说明也有!
------解决方案--------------------三部分组成:
1.Page.jsp
2.Connection_database.java (已经给了你了)
3.Bean_MyUsers.java
4.book.mdb (Access数据库)
------------
Page.jsp
<%@page contentType= "text/html; charset=GBK "%>
<%@page import= "java.util.ArrayList "%>
<%@page import= "bean.* "%>
<%@page import= "connection.* "%>
<%@page import= "servlet.* "%>
<html>
<head>
<title> 基本信息 </title>
</head>
<body bgcolor= "#ffffff ">
<center>
<h1> 人员基本信息 </h1>
<hr/>
<table border= "1 ">
<tr align= "center " valign= "middle ">
<td> 编号 </td>
<td> 用户名 </td>
<td> 密码 </td>
<td> 真实姓名 </td>
<td> 性别 </td>
<td> 住址 </td>
<td> 电话 </td>
<td> 邮编 </td>
<td> Email </td>
<td> 注册时间 </td>
</tr>
<%
String sql = "select * from My_Users ";
ArrayList list = new Connection_database().getlist(sql);
Bean_MyUsers bmu = new Bean_MyUsers();
for (int i = 0; i < list.size(); i++) {
bmu = (Bean_MyUsers) list.get(i);
%>
<tr align= "center " valign= "middle ">
<td> <%=bmu.getId()%> </td>
<td> <%=bmu.getUserName()%> </td>
<td> <%=bmu.getPassWord()%> </td>
<td> <%=bmu.getNames()%> </td>
<td> <%=bmu.getSex()%> </td>
<td> <%=bmu.getAddress()%> </td>
<td> <%=bmu.getPhone()%> </td>
<td> <%=bmu.getPost()%> </td>
<td> <%=bmu.getEmail()%> </td>
<td> <%=bmu.getRegTime()%> </td>
</tr>
<%}%>
</table>
</center>
</body>
</html>
------------
Bean_MyUsers.java
package bean;
public class Bean_MyUsers {
private int id;
private String userName;
private String passWord;
private String names;
private String sex;
private String address;
private String phone;
private String post;
private String email;
private String regTime;
public void setId(int id) {
this.id = id;
}
public void setUserName(String userName) {
this.userName = userName;
}
public void setPassWord(String passWord) {
this.passWord = passWord;
}
public void setNames(String names) {
this.names = names;
}
public void setSex(String sex) {
this.sex = sex;
}
public void setAddress(String a