You can't do it that way. Ideally, use a PreparedStatement set the where clause as: "WHERE Event_Name= ? ", then use ps.setString(1,eveyType.xxx);
Another, BAD method is to append them together like so:
"WHERE Event_Name = '" + eveyType.xxx + "'";
However this is very dangerous since it allows script injection. Basically whoever provides the value for the string (ie the user) could use it to force an SQL command to be executed in your database - and that includes dropping the table etc.
|