问高手这段代码哪错了,为什么一编译就报错:javax.servlet.ServletException: [Microsoft][ODBC SQL Server Driver]无效的描述符索引??
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="bookstore.*"%>
<%@ page import="java.sql.*" %>
<jsp:useBean id="userBean" scope="page" class="bookstore.User" />
<jsp:setProperty name="userBean" property="*" />
<%
Connection conn = null;
String url = "jdbc:odbc:testjsp";
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //加载驱动,固定写法
conn = DriverManager.getConnection(url); //获取连接
PreparedStatement pStat = conn.prepareStatement(
"select * from T_user");
ResultSet rs = pStat.executeQuery(); %>
<table border="2" width="100%" bgcolor="red">
<th> id </th>
<th> name </th>
<th> pass </th>
<%while(rs.next()){%>
<tr>
<td><%=rs.getString("user_id")%>
</td>
<td><%=rs.getString("user_name")%>
</td>
<td><%=rs.getString("password")%>
</td>
<td>
<a href=javascript:openWindow('userEdit.jsp?userID=<%=rs.getString("user_id")%>','userEdit', 550, 400);>[edit]</a>
</td>
<td>
<a href=javascript:openWindow('userDelete.jsp?userID=<%=rs.getString("user_id")%>','userDelete', 550, 400);>[delete]</a>
</td>
</tr>
<%}%>
</table>
<%}finally{
if(conn!=null) conn.close();
}
%>
在线等!急!:10::10::10: