I have an error
java.sql.SQLException: ORA-00933: SQL Command not properly ended
when I try to execute the following SQL Statement.
In this statement, it is supposed to display all the rental details and feedback for a particular customer when a customer name is searched. "query" refers to the user input when the user searches for a name (CustomerName) in the database.
SELECT c.CustomerName, r.Rental_ID, r.Staff_ID, r.RentalDate, r.DueDate,
r.Customer_ID, f.Description
FROM Rental r, Customer c, FeedBack f
WHERE f.Customer_ID = r.Customer_ID
AND c.Customer_ID = f.Customer_ID
ORDER BY DueDate
WHERE CustomerName like "+ query +";
What went wrong?
PreparedStatementsso as to avoid the glaring sql injection vulnerability.