This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I need to create a query based on ceratin search condition in which i get a list at some condition in the middle of the query construction ..
I first create a query by using stringBuilder and append the string based on the various condition and in one such condition i get list and
i have appened in the sting as list and based on few conditions the query is now generated and i could not get the correct answer
Firstly, do not ever use '==' to check object equality. Always use equals method. If you have to use '==', then be extremely sure that you really need it, and that you know what you are doing.
Secondly, I didn't get how the list will be part of the query. Can you provide a sample query which contains contents of list? If you need to check if some value is on of those presents in the list, then you can use 'IN' syntax of SQL (e.g. value IN (a,b,c) etc.)
I've moved your question to the JDBC forum, where you'll get more attention from people who deal with JDBC. Also, I've added code tags to the code in your post and indented it a bit to improve readability; you can do so yourself using the Code button while editing your post.
What you intend to do is generally not possible. Several workarounds are possible. For starters, try to look here: