lessonplan character updates so it also works on Windows Cp125
This commit is contained in:
committed by
Nanne Baars
parent
6b68a12449
commit
6f532683a1
@ -1,4 +1,4 @@
|
||||
== Parameterized Queries – Java Example
|
||||
== Parameterized Queries - Java Example
|
||||
[source,java]
|
||||
-------------------------------------------------------
|
||||
public static String loadAccount() {
|
||||
@ -15,10 +15,10 @@ public static String loadAccount() {
|
||||
if (results.getRow() <= 2) {
|
||||
data = processAccount(results);
|
||||
} else {
|
||||
// Handle the error – Database integrity issue
|
||||
// Handle the error - Database integrity issue
|
||||
}
|
||||
} else {
|
||||
// Handle the error – no records found }
|
||||
// Handle the error - no records found }
|
||||
}
|
||||
} catch (SQLException sqle) {
|
||||
// Log and handle the SQL Exception }
|
||||
|
@ -1,7 +1,7 @@
|
||||
== Parameterized Queries – .NET
|
||||
== Parameterized Queries - .NET
|
||||
-------------------------------------------------------
|
||||
public static bool isUsernameValid(string username) {
|
||||
RegEx r = new Regex(“^[A-Za-z0-9]{16}$”);
|
||||
RegEx r = new Regex("^[A-Za-z0-9]{16}$");
|
||||
Return r.isMatch(username);
|
||||
}
|
||||
|
||||
@ -18,5 +18,5 @@ try {
|
||||
}
|
||||
} else { // handle invalid input }
|
||||
}
|
||||
catch (Exception e) { // Handle all exceptions… }
|
||||
catch (Exception e) { // Handle all exceptions... }
|
||||
-------------------------------------------------------
|
||||
|
@ -6,7 +6,7 @@
|
||||
=== Prevents other types of attacks from being stored in the database
|
||||
* Stored XSS
|
||||
* Information leakage
|
||||
* Logic errors – business rule validation
|
||||
* Logic errors - business rule validation
|
||||
* SQL injection
|
||||
|
||||
=== Often the database is considered trusted
|
||||
|
@ -1,4 +1,4 @@
|
||||
== Parameterized Queries – Java Snippet
|
||||
== Parameterized Queries - Java Snippet
|
||||
[source,java]
|
||||
----
|
||||
public static bool isUsernameValid(string username) {
|
||||
@ -21,5 +21,5 @@ try {
|
||||
}
|
||||
} else { // handle invalid input }
|
||||
}
|
||||
catch (…) { // handle all exceptions … }
|
||||
catch (...) { // handle all exceptions ... }
|
||||
----
|
||||
|
Reference in New Issue
Block a user