What does “if (rs.next())” mean?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am currently getting the error, java . sql . SQLException : Method 'executeQuery(String)' not allowed on prepared statement . because I am using PreparedStatement stmt = conn . prepareStatement ( sql ); and also had ResultSet rs = stmt . executeQuery ( sql ); in my code. I now need to remove the ResultSet line but that leaves me with having to deal with the following code: if ( rs . next ()) { messages . add ( ActionMessages . GLOBAL_MESSAGE , new ActionMessage ( "login.successful" )); request . getSession ( true ). setAttribute