SP操作Access數據庫
最近在用JSP寫公司的網站示例程序時
首先
DatabaseDemo
<%@ page language="java" contentType="text/html;charset=gb
<%@ page import="java
<%@ page import="java
<%
String UserNameV="";
String PassWordV="";
try
{
$False$
路徑
String p=request
String path=request
path=path
String dbpath=path+"UserDatabase
String dbname="";
String user="";
//連接Access數據庫的連接字符串
String url="jdbc:odbc:Driver={Microsoft Access Driver (*
//創建連接對象和Statement對象
Class
Connection conn=DriverManager
Statement stmt=conn
String sql="select * from UserInformation";
ResultSet rs=stmt
while(rs
{
UserNameV=rs
PassWordV=rs
BR>
// out
out
out
}
rs
stmt
conn
}
catch (Exception e)
{//Error
out
}
%>
其次
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20553.html