Skip to content

Instantly share code, notes, and snippets.

@r-winkler
Last active August 30, 2016 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r-winkler/fa891a0670170649cb8c702e7342bb30 to your computer and use it in GitHub Desktop.
Save r-winkler/fa891a0670170649cb8c702e7342bb30 to your computer and use it in GitHub Desktop.
String email = request.getParameter("email");
String password = request.getParameter("password");
String sql = "select * from users where (email ='" + email +"' and password ='" + password + "')";
Connection connection = pool.getConnection();
Statement statement = connection.createStatement();
ResultSet result = statement.executeQuery(sql);
if (result.next()) {
loggedIn = true;
// # Successfully logged in and redirect to user's profile page
} else {
// # Auth failure - Redirect to Login Page
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment