热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_47526498
初 来乍到
5 年前
trueweixin_47526498

public Boolean validateLogin(String user, String password) {
Boolean count = false;
String sql = "select Id from student where Id = '" + password + "'";
SQLcontent S = new SQLcontent();
Statement sc = null;
try {
sc = S.sqlcontent().createStatement();
} catch (SQLException throwables) {
throwables.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
ResultSet rs = null;
try {
rs = sc.executeQuery(sql);
if (rs.next())
count = true;
} catch (SQLException throwables) {
throwables.printStackTrace();
}
return count;
}

为什么返回值一直是空null啊....

程序员写BUG的日常
CSDN App 扫码分享
分享
评论
1
打赏
  • 复制链接
  • 举报
下一条:
public Boolean validateLogin(String user, String password) { Boolean count = false; String sql = "select Id from student where Id = '" + password + "'"; SQLcontent S = new SQLcontent(); Statement sc = null; try { sc = S.sqlcontent().createStatement(); } catch (SQLException throwables) { throwables.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } ResultSet rs = null; try { rs = sc.executeQuery(sql); if (rs.next()) count = true; } catch (SQLException throwables) { throwables.printStackTrace(); } return count; }上边代码,最后返回的count为什么一直是null......,救救孩子。
立即登录