谁能帮我解决下这个问题啊 这是我的SERVLET 同样的语句在JSP页面下可以显示 但是Servlet就不行
package people;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class query extends HttpServlet{
public void init() throws ServletException{
super.init();}
//执行HTTP POST请求
public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
{
PrintWriter out=response.getWriter();
response.setContentType("text/html; charset=GBK");
response.setCharacterEncoding("GBK");
out.print("<html>");
out.print("<body>");
//获得客户端用post方法传来的数据
String number=request.getParameter("number");
String name=request.getParameter("name");
String sex=request.getParameter("sex");
String nianlin=request.getParameter("nianlin");
String jiguan=request.getParameter("jiguan");
String yuanxi=request.getParameter("yuanxi");
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");}
catch(ClassNotFoundException e){e.printStackTrace();}
try{
conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=university","sa","");
stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql="select * from student where Xuehao like "+"'"+number+"'";
rs=stmt.executeQuery(sql);
out.print("<table>");
out.print("<tr>");
out.print("<th width=100>"+"Xuehao"+"</th>");
out.print("<th width=100>"+"Name"+"</th>");
out.print("<th width=50>"+"Sex"+"</th>");
out.print("<th width=50>"+"Age"+"</th>");
out.print("<th width=100>"+"Jiguan"+"</th>");
out.print("<th width=100>"+"Dept"+"</th>");
out.print("</tr>");
//循环显示结果
while(rs.next())
{
out.print("<tr>");
out.print("<td>"+rs.getString(1)+"</td>");
out.print("<td>"+rs.getString(2)+"</td>");
out.print("<td>"+rs.getString(3)+"</td>");
out.print("<td>"+rs.getString(4)+"</td>");
out.print("<td>"+rs.getString(5)+"</td>");
out.print("<td>"+rs.getString(6)+"</td>");
out.print("</tr>");
out.print("</table>");
}
conn.close();
}catch(SQLException e){out.println(e.getMessage());}
out.print("</body>");
out.print("</html>");
}
public void doGett(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
{
}
public void destroy(){
}
}