mysql - Java WEB 参数正常,各项正常,无法从数据库获取结果?
ringa_lee
ringa_lee 2017-04-18 10:06:51
0
5
634
ringa_lee
ringa_lee

ringa_lee

reply all(5)
巴扎黑

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

黄舟

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

PHPzhong

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. .

巴扎黑

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

迷茫

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template