请帮忙看一下一下代码为什么提示以下错误Unable to compile class for JSP
<%@ page language="java" contentType="text/html; charset=GB2312"%>
<%@ page import="java.sql.*,java.io.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>pages</title>
</head>
<body>
<%
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
int totalcount = 0;
int totalpages = 0;
try{
//A.注册驱动
Driver driver = new com.mysql.jdbc.Driver();//此处报错,An error occurred at line: 19 in the jsp file: /page.jsp
com.mysql.jdbc.Driver cannot be resolved to a type
DriverManager.registerDriver(driver);
//B.获取数据库连接
String url ="jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=GB2312&useSSL=false";
String user = "root";
String password = "123";
conn = DriverManager.getConnection(url, user, password);
//C.获取数据库操作对象
stmt = conn.createStatement();
/*
实现SQL结果集分页功能
*/
//D.执行SQL语句
//1.获得总的记录数TotalCount
String sql = "select * from student ";
rs = stmt.executeQuery(sql);
while(rs.next()){
totalcount = rs.getInt("id");
}
System.out.println(totalcount);
}catch(Exception e){
e.printStackTrace();
}finally{
if(rs != null){
try{
rs.close();
}catch(Exception e){
e.printStackTrace();
}
}
if(stmt != null){
try{
stmt.close();
}catch(Exception e){
e.printStackTrace();
}
}
if(conn != null){
try{
conn.close();
}catch(Exception e){
e.printStackTrace();
}
}
}
%>
</body>
</html>