问答详情
源自:8-6 所有商品信息显示

为什么我的页面仍显示“商品展示”这四个大字,其他就没有显示了

java.sql.SQLException: 关闭的连接


at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3492)

at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3393)

at dao.ItemsDAO.getAllItems(ItemsDAO.java:26)

at org.apache.jsp.index_jsp._jspService(index_jsp.java:126)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

这是显示出错的原因,我把数据库重启了几遍也不行,又以为是jar包问题,重新换了一个也不行,求指教!

提问者:qq_火兹_03896205 2017-01-14 21:07

个回答

  • 狂人的哀伤
    2017-11-05 21:15:26

    想想你的数据库有么有密码,回到DBHelper.java,

    private static final String password="123456";//数据库的密码,

    我安装mysql有设置密码,这是我解决办法

  • qq_路漫漫_7
    2017-07-26 19:22:36

    应该是你连接的数据库地址、名称或者密码错误了。

  • 终有弱水替沧海4032800
    2017-03-06 21:36:27

    我解决了 ,你看看数据库是不是连接错了,我是连错了数据库

  • 终有弱水替沧海4032800
    2017-03-06 21:16:27

    我也是这个错误,求解决办法

  • Trish
    2017-01-23 23:12:23

    看起来是数据库有问题,建议先别加获取商品的代码,单独把数据库调通了再逐步增加功能