Skip to content

Instantly share code, notes, and snippets.

@6a6f6a6f
Created February 23, 2022 20:29
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 6a6f6a6f/4db1b31311cd5c2080681a2ae3071b2b to your computer and use it in GitHub Desktop.
Save 6a6f6a6f/4db1b31311cd5c2080681a2ae3071b2b to your computer and use it in GitHub Desktop.
fun validateUser(username: String, password: String): Boolean {
// ...
val sql = "SELECT COUNT(*) FROM USER WHERE USERNAME = '" + username + "' AND PASSWORD = '" + password + "'"
val rs = statement.executeQuery(sql)
// ...
val result = rs.getInt(1) > 0
// ...
return result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment