enter image description here
this is the query i have written


this is the exception that is showing 
enter image description here
this is the query i have written


this is the exception that is showing 
There is a trailing ' missing at '"+roomid+"'). Also looking at your code, my suggestion is for you to use parameterized queries instead of writing the SQL query directly and appending values to it. That way it will be cleaner, protected from SQL injection and you won't get any syntax errors like these.