|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.samples.SQLInjection
public class SQLInjection
SQL Injection is a common security vulnerability for applications that use database. It is one of the most common security vulnerabilities for web applications today. This sample application shows how SQL injection works, and how to protect the application from it.
Constructor Summary | |
---|---|
SQLInjection()
|
Method Summary | |
---|---|
static java.lang.String |
changePassword(java.sql.Connection conn,
java.lang.String userName,
java.lang.String password)
Utility method to change a password of a user. |
static java.sql.ResultSet |
getUser(java.sql.Connection conn,
java.lang.String userName,
java.lang.String password)
Utility method to get a user record given the user name and password. |
static void |
main(java.lang.String... args)
This method is called when executing this sample application from the command line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SQLInjection()
Method Detail |
---|
public static void main(java.lang.String... args) throws java.lang.Exception
args
- the command line parameters
java.lang.Exception
public static java.sql.ResultSet getUser(java.sql.Connection conn, java.lang.String userName, java.lang.String password) throws java.lang.Exception
conn
- the database connectionuserName
- the user namepassword
- the password
java.lang.Exception
public static java.lang.String changePassword(java.sql.Connection conn, java.lang.String userName, java.lang.String password) throws java.lang.Exception
conn
- the database connectionuserName
- the user namepassword
- the password
java.lang.Exception
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |