You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Edwin Lukaweski <se...@rogers.com> on 2006/06/22 20:29:14 UTC
sql map via Java API
Hi:
Is there any way of submitting a new <select>.....</select> SQL Map snippet via the Java API. Or, alternatively, is there a way of contructing an object, from iBatis, that accomplishes the same thing?
What I am trying to do is build a SELECT statement at execution time, based on parameters entered, but after ibatis has been initialized. I would then like to load it into an SQL-MAP for a specific table (namespace ID) and then use the standard interface calls.
Thanks,
Edwin
Re: sql map via Java API
Posted by Edwin Lukaweski <se...@rogers.com>.
Yes - good one!!!
However, just to carry this a bit further, ideally, I would like to have
iBatis prepare this once and then use the prepared statement.
As I understand it, 'remapResults=true' will force a lot of work due to
examining the result set meta data. Also, I would imagine that the
$generatedSqlStatement$ will also be prepared on each call.
I guess I could go straight to the JDBC driver but will that interfere
with iBatis' operation?
Thanks,
Edwin
----- Original Message -----
From: "Larry Meadors" <lm...@apache.org>
To: <us...@ibatis.apache.org>
Sent: Thursday, June 22, 2006 2:52 PM
Subject: Re: sql map via Java API
> Yeah, it's risky, but life is about risks, right? :-)
>
> <select id="injectMeBaby"
> remapResults="true">$generatedSqlStatement$</select>
>
> Larry
>
>
> On 6/22/06, Edwin Lukaweski <se...@rogers.com> wrote:
>>
>>
>> Hi:
>>
>> Is there any way of submitting a new <select>.....</select> SQL Map
>> snippet via the Java API. Or, alternatively, is there a way of
>> contructing
>> an object, from iBatis, that accomplishes the same thing?
>> What I am trying to do is build a SELECT statement at execution time,
>> based on parameters entered, but after ibatis has been initialized. I
>> would
>> then like to load it into an SQL-MAP for a specific table (namespace ID)
>> and
>> then use the standard interface calls.
>>
>> Thanks,
>> Edwin
>>
>
Re: sql map via Java API
Posted by Larry Meadors <lm...@apache.org>.
Yeah, it's risky, but life is about risks, right? :-)
<select id="injectMeBaby" remapResults="true">$generatedSqlStatement$</select>
Larry
On 6/22/06, Edwin Lukaweski <se...@rogers.com> wrote:
>
>
> Hi:
>
> Is there any way of submitting a new <select>.....</select> SQL Map
> snippet via the Java API. Or, alternatively, is there a way of contructing
> an object, from iBatis, that accomplishes the same thing?
> What I am trying to do is build a SELECT statement at execution time,
> based on parameters entered, but after ibatis has been initialized. I would
> then like to load it into an SQL-MAP for a specific table (namespace ID) and
> then use the standard interface calls.
>
> Thanks,
> Edwin
>