sm = ct.prepareStatement("select unino,password,spec4,attrs from userinfo where unino=?");
sm.setString(1, "8431");
rs = sm.executeQuery();
这个不知道为什么就是取不到数据,
可是改成 sm = ct.prepareStatement("select unino,password,spec4,attrs from userinfo where unino='8431'");又可以从数据库取到,不只有这个地方,还有许多其他也有这种问题,然后奇怪的就是,有的地方他有没有这种问题!
...全文
22216打赏收藏
prepareStatement有时无法从数据库获得数据
sm = ct.prepareStatement("select unino,password,spec4,attrs from userinfo where unino=?"); sm.setString(1, "8431"); rs = sm.executeQuery(); 这个不知道为什么就是取不到数据, 可是改成 sm = ct.prepareStatement("select unino,password,spec4,attrs from userinfo where unino='8