I am new to Java, so please forgive me if it is a naive question. I have a string that is in comma separated like this "str1, str2,str3" .I need to query data from database that matches that list of strings. I know I can convert "str1,str2,str3" to an array. But would also need to pass this in a IN clause of sql query like this
select * from Customer where name IN ('str1','str2','str3')
How can I accomplish that since after the conversion of "str1,str2,str3" to an array won't be legal to pass it in IN clause?
Any utility method in hibernate that can help taking care of this issue?
Thank you in advance
str1,str2,str3into a list and use that list in a prepared statement or hql.name IN ([str1,str2,str3])query which is invalid.Unless I am missing something