Hi Everybody,
Im having a bit of a problem with an assignment..Im trying to write a JDBC servlet which checks the value of a name in the database against the value inputed in a form..USER and PASS are the values inputted to the by user into the form.. The code is below..But im getting a syntax error on the the italics lines below which says: Syntax error on tokens, (expected instead))
I dont know what is wrong with my syntax here..Can someone help me out please?
try {
stmt = con.createStatement();
rs = stmt.executeQuery(SELECT * FROM FMC_EMPLOYMENT WHERE SURNAME='" +
req.getParameter("USER"))+ "' and PASSWORD = '" + req.getParameter("PASS")"');
while (rs.next())
out.println("<BR>Name=" + rs.getString("SURNAME") + " " + rs.getString("PASSWORD"));
}