MySql换成sqlserver就报错了
jar包添加了,数据库连接也修改好了,请大师指教还需要改什么?
private static final String DRIVER="com.microsoft.sqlserver.jdbc.SQLServerDriver";
private static final String URL="jdbc:sqlserver://localhost:1433;databasename=shopping";
private static final String USERNAME="sa";
private static final String PASSWORD="123";
错误如下
org.apache.jasper.JasperException: An exception occurred processing JSP page /welcome.jsp at line 26
23: </head>
24:
25: <body>
26: <jsp:forward page="IndexServlet"></jsp:forward>
27: </body>
28: </html>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.xasxt.shopping.util.EncodingFilter.doFilter(EncodingFilter.java:26)
root cause
java.lang.NullPointerException
com.xasxt.shopping.dao.BaseDao.execQuery(BaseDao.java:46)
com.xasxt.shopping.dao.impl.AfficheDaoImpl.getAll(AfficheDaoImpl.java:48)
com.xasxt.shopping.biz.impl.AfficheBizImpl.getAll(AfficheBizImpl.java:29)
com.xasxt.shopping.servlet.IndexServlet.doPost(IndexServlet.java:38)
com.xasxt.shopping.servlet.IndexServlet.doGet(IndexServlet.java:30)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:706)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:677)
org.apache.jsp.welcome_jsp._jspService(welcome_jsp.java:85)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.xasxt.shopping.util.EncodingFilter.doFilter(EncodingFilter.java:26)
------解决方案--------------------应该是你没有换驱动吧,mysql和sql2008的驱动是不同的