I prefer the use of java.sql.Array and a custom TypeHandler and to keep the sql
as simple as possible.
Here is an example for Ibatis 2.
Create an IntArrayTypeHandler class and register it in the config.
public class IntArrayTypeHandler
implements TypeHandlerCallback
{
public void setParamete
1/2010 3:41 PM, mukhi wrote:
>>>>>>
>>>>>>>
>>>>>>> I am using Spring with Ibatis. I want to pass a sting value and list
>>>>>>
-
To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org
For additional commands, e-mail: user-java-h...@ibatis.apache.org
--
View this message in context:
http://old.nabble.com/how-to-pass-two-different-types-of-val
entryRefno#,CHOICE_REFNO,
>>>>> FROM T_CHOICE
>>>>> WHERE CHOICE_REFNO IN ( 90,89,93,45,67)
>>>>>
>>>>>
>>>>>
>>>>> in the above query
On 4/12/2010 10:24 AM, mukhi wrote:
Thanks, but the parameter 'entryrefno' is of numeric type in my table. How
can i pass two different types of values to Map at the same time?
Please reply me. I am struck at this point.
If you added that numeric value to your map before you passed it in,
li
There you go, much cleaner, thanks for correcting me, I had not used that
particular functionality before.
François
On Apr 12, 2010, at 11:00 AM, Martin Ellis wrote:
> 2010/4/12 François Schiettecatte :
>> I think Mukhi is trying to pass a string and an array of numbers, the string
>> being th
2010/4/12 François Schiettecatte :
> I think Mukhi is trying to pass a string and an array of numbers, the string
> being the entryRefno and the list of nunbers to be added to the IN() clause
> of the SELECT statement in the example given.
>
> The Map is the way to go, you just need to add the st
>>>
>>>>
>>>>
>>>> in the above query i need to pass two types of parameters.
>>>> 1. Sting
>>>> 2.list of values in where clause.
>>>>
>>>> How can i do it?
>>>>
>>>>
>>>
es in where clause.
>>>
>>> How can i do it?
>>>
>>>
>>> What kind of parameter I can pass to call the query. while making call
>>>
>>> getSqlMapClientTemplate().insert("insertChoice", What parameter goes
>>> here?);
call
>>
>> getSqlMapClientTemplate().insert("insertChoice", What parameter goes
>> here?);
>
>
> ---------------------
> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org
> For additional com
Hi mukhi--
I'm pretty new to this list, but I believe the general solution is to
make a HashMap and pass that in:
Map params = new HashMap();
params.entryRefno= myEntryRefno;
params.someList = someList;
getSqlMapClientTemplate().insert("insertChoice", params);
In iBatis 3 you also have the op
("insertChoice", What parameter goes
here?);
--
View this message in context:
http://old.nabble.com/how-to-pass-two-different-types-of-values-to-query-in-IBATIS-tp28211187p28211187.html
Sent from the iBATIS - User - Java mailing list archive at
12 matches
Mail list logo