search

Home  >  Q&A  >  body text

mysql - Java WEB 参数正常,各项正常,无法从数据库获取结果?

ringa_leeringa_lee2783 days ago637

reply all(5)I'll reply

  • 巴扎黑

    巴扎黑2017-04-18 10:08:51

    So it is recommended to check what the username and password passed by the request are

    reply
    0
  • 黄舟

    黄舟2017-04-18 10:08:51

    My guess is that there is no jdbc jar package in tomcat. You can post all the logs and let everyone take a look, so that the problem can be found

    reply
    0
  • PHPz

    PHPz2017-04-18 10:08:51

    Please think about the following questions:
    1.
    request.getParameter("userName"); When you pass the parameter, userName is in middle capital letters? I don't see it. name="username"?
    2.
    The test method only means that there is no problem with your DAO, your database is not connected to the wrong place, and the database table can get data.
    3.
    Problems often appear at the source. Don’t get hung up on the process. Your process code is very stable. Maybe you didn't get the first step. It was forwarded directly. Have you paid attention? After forwarding, continue running userName="", of course you can't get it, and you didn't return in time.
    4.
    Just hit a few breakpoints and run for a while, especially when taking parameters. .

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-18 10:08:51

    For this kind of problem, use DeBug mode and set more breakpoints, such as selectUser里边的if处,还有其他的与相关数据at locations that may be involved

    reply
    0
  • 迷茫

    迷茫2017-04-18 10:08:51

    Just set a breakpoint to debug and see where the parameters are wrong

    reply
    0
  • Cancelreply