ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James, Steven" <Steven.Ja...@logicacmg.com>
Subject RE: how to define multiple input parameters in select statement
Date Tue, 12 Jul 2005 12:31:01 GMT
use a search object and pass that in as parameterClass or set up a parameterMap, or use a list
or hashmap... Check these out in the 
example jpetstore and also the have a look at the ibatis pdf docs they are well written and
cover  these types of questions.

Steve

-----Original Message-----
From: Ashish Kulkarni [mailto:kulkarni_ash1312@yahoo.com]
Sent: Mon 7/11/2005 11:23 PM
To: user-java@ibatis.apache.org
Subject: how to define multiple input parameters in select statement
 
Hello
If my sql statement is "select * from abc where a = ?"
then i define in my xml file as below
<select id="getPOData" resultClass="DataBean"
		parameterClass="java.math.BigDecimal">
  SELECT * from abc where a = #value#>
</select>
In my java program i do
List list  = sqlMap.queryForList("getPOData",
bigDecimal);

Q1 If i have multiple parameters in select statement
how do i define, 
for example my sql statement will be 
select * from abc where a =? and b =? and c=?

Ashish


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It
may contain proprietary material, confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any other party. If you are not
an intended recipient then please promptly delete this e-mail and any attachment and all copies
and inform the sender. Thank you.

Mime
View raw message