Bug fix in sample code
This commit is contained in:
parent
5921a06747
commit
6699456ee1
@ -11,7 +11,7 @@ PreparedStatement ps = null;
|
|||||||
RecordSet rs = null;
|
RecordSet rs = null;
|
||||||
try {
|
try {
|
||||||
pUserName = request.getParameter("UserName");
|
pUserName = request.getParameter("UserName");
|
||||||
if ( isUsernameValid (pUsername);
|
if ( isUsernameValid (pUsername) ) {
|
||||||
ps = conn.prepareStatement("SELECT * FROM user_table
|
ps = conn.prepareStatement("SELECT * FROM user_table
|
||||||
WHERE username = ? ");
|
WHERE username = ? ");
|
||||||
ps.setString(1, pUsername);
|
ps.setString(1, pUsername);
|
||||||
@ -22,4 +22,4 @@ try {
|
|||||||
} else { // handle invalid input }
|
} else { // handle invalid input }
|
||||||
}
|
}
|
||||||
catch (…) { // handle all exceptions … }
|
catch (…) { // handle all exceptions … }
|
||||||
----
|
----
|
||||||
|
Loading…
x
Reference in New Issue
Block a user