jsp连接Access
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" import="java.util.*" import="java.io.*" import="java.text.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>数据库连接</title>
</head>
<body>
<%
String dbname="";
String user="";
Connection con=null;
Statement stmt=null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(ClassNotFoundException e){out.print ("驱动程序不存在"); }
try{
String url="jdbc:odbc:driver={Microsoft Access Driver(*.mdb)};DBC=D:\\Program Files\\Tomcat 6.0\\webapps\\szmc_app\\data\\commu.mdb";
con=DriverManager.getConnection(url,"","");
stmt=con.createStatement();
String query="select uName from commu.user_manage where pWord='xll2111'";
ResultSet rs=stmt.executeQuery(query);
while(rs.next())
{
String str=rs.getString("nName");
out.print(str);
}
}catch(SQLException e){e.printStackTrace();}
%>
</body>
</html>
热切恳求高手给我看看,
为什么此代码在tomcat6.0中运行之后,
没有出错, 但是也没输出, 即没有实现功能??
感激不尽!!