<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!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=gb2312">
<title>无标题文档</title>
</head><body>
<%
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
String sql="Select * from tb_user";
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); 
try{
conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=db_board;user=sa;password=");stmt=conn.createStatement();
rs=stmt.executeQuery(sql);
}catch(Exception e){
out.print("jdbc:odbc 错误");
}
if(rs.next()){
out.println(rs.getString("UserName"));
}
%>
</body>
</html>
为什么连接不上,代码是没有问题,我不知道是驱动问题不?