A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
Can you use jdbcTemplate QueryForList with SQL "in" Expression?
Joined: Jul 12, 2002
Apr 16, 2013 16:37:25
Does the queryForList work when you have an "in" expression in your SQL like this:
Select * from CUSTOMER where CUST_ID in (1,5,7,9)
My question is whether the "in" is supported in queryForList?
We seem to be having problems with it and all the examples I've seen don't use it.
Is there a better JDBCTemplate method to use for multiple "in" values?
Joined: Feb 08, 2009
Apr 17, 2013 23:48:34
prepared statements does not supported "in" clause for multiple values due to SQL injection attack security issue
Any code based on prepared statements (JDBC templates) does not support 'IN' clauses in queries.
Here is a good resource that provide alternate approaches
Cheers - Sam.
Twisters - The new age Java Quiz
It is sorta covered in the
JavaRanch Style Guide
subject: Can you use jdbcTemplate QueryForList with SQL "in" Expression?
Anyone know where I can find a short explanation of how to use getJdbcTemplate?
Displaying Sql query string results in jsp by using Spring Framework
Which framework would be the best ?
spring jdbc and action class
JDBCTemplate QueryForList returns wrong value
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014