[求助]菜鸟求助
<%@ page language = "java"%><%@ page import = "java.sql.*"%>
<%@ page contentType = "text/html; charset=GB2312"%>
<html>
<head>
<title>access database</title>
</head>
<body>
<%
String DBDriver = "sun.jdbc.odbc.jdbcOdbcDriver";
try{
Class.forName(DBDriver);
}
catch(Exception e)
{
out.println("first error!");
}
try{
Connection con = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:\\Tomcat 5.0\\webapps\\mywebapps\\user.mdb","","");
Statement stmt = con.createStatement();
stmt.close();
con.close();
}
catch(SQLException e)
{
e.printStackTrace();
out.println(" second error!");
}
%>
</body>
</html>
这是我抄的程序,错误出在Class.forName(DBDriver),
不知道是不是设置有问题,不过我做别的jsp,servlet,bean都没问题啊,就是连数据库不行,都要疯了!!!
好心的大哥大姐帮帮忙啊
先谢谢拉