Misc. Announcements Pre-Test2 (with past test questions!) and Final Milestone are posted! Which teams to go first? 2 options Any volunteers for the first meeting day next week? We need at least two!
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
String queryStr = "Select count(*) from IdPassword where Id = ‘ " +
userName + " ‘ and Password = ‘ " + password + " ‘ ";
rs = stmt.executeQuery(queryStr);
// if login info is invalid, rs will have a row and the count will be 0.
// Else, login is good.
rs.next(); // get the count
if (rs.getInt(1) == 0)
outStr += "Your login info is incorrect. Try again.";
outStr += "Welcome back," + userName + ". Please buy something this time :)";
where Id = ‘11111’ and Password = 'helloJava';
where Id = ‘12345’ or ‘1’=‘1’
and Password = 'abcxyz' or '1'='1';
Ref: sdtimes, 2006