还是一样不行。。。
我把错误帖出来,高手帮我看看是什么原因。
org.apache.jasper.JasperException: Exception in JSP: /index.jsp:28
25: String title="no data";
26: String content="no data";
27: ControlDb.ConnectDatabase();
28: ResultSet rs=ControlDb.ExecuteQuery("select top 1 NewsID,Title,Content from News order by NewsDateTime desc");
29: if(rs.next()) {
30: id=rs.getInt("NewsID");
31: title=rs.getString("Title");
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NullPointerException
web.ControlDatabase.ExecuteQuery(ControlDatabase.java:51)
org.apache.jsp.index_jsp._jspService(index_jsp.java:80)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)