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 Vic Cekvenich <vi...@friendvu.com> on 2004/12/24 21:04:49 UTC
how to get the real sql
I can't get a simple mapped statement to work:
SELECT
max(msg_num) as msg_num
from load_articles
where club_id = #club_id#
Anyone know how can I get the real sql that executes with the parm and
real data returned in debug mode? (when I try in sql console it works
easily)
getSql?
getRowSet?
get the full sourcecode and trace?
tia,
.V
--
RiA-SoA w/JDNC <http://www.SandraSF.com> forums
- help develop a coomunity
My blog <http://www.sandrasf.com/adminBlog>
Re: how to get the real sql
Posted by Vic Cekvenich <vi...@friendvu.com>.
There was no error thrown. I found the problem later that I did not in
XML declare a return object ( a HashMap in my case).
Still it seems that it be possible to get the handle to the
preparedstatment.
Merry Xmass all.
.V
Clinton Begin wrote:
>If you could, that would be a driver level option. iBATIS never
>merges the parameters for you, it lets the PreparedStatement
>implementation do that.
>
>What's the error you're getting?
>
>Clinton
>
>
>On Fri, 24 Dec 2004 14:04:49 -0600, Vic Cekvenich <vi...@friendvu.com> wrote:
>
>
>>I can't get a simple mapped statement to work:
>>
>>SELECT
>> max(msg_num) as msg_num
>> from load_articles
>> where club_id = #club_id#
>>
>>Anyone know how can I get the real sql that executes with the parm and
>>real data returned in debug mode? (when I try in sql console it works
>>easily)
>>
>>getSql?
>>getRowSet?
>>
>>get the full sourcecode and trace?
>>
>>tia,
>>.V
>>
>>--
>>RiA-SoA w/JDNC <http://www.SandraSF.com> forums
>>- help develop a coomunity
>>My blog <http://www.sandrasf.com/adminBlog>
>>
>>
>>
>
>
>
>
--
RiA-SoA w/JDNC <http://www.SandraSF.com> forums
- help develop a coomunity
My blog <http://www.sandrasf.com/adminBlog>
Re: how to get the real sql
Posted by Ron Grabowski <ro...@yahoo.com>.
The last Java project I used iBatis on had log4net setup to print out
useful statements during development:
DEBUG - Checked out connection 3976572 from pool.
DEBUG - {conn-100010} Connection
DEBUG - {pstm-100011} PreparedStatement: SELECT foo, bar FROM baz WHERE
foo = ?
DEBUG - {pstm-100011} Parameters: [11]
DEBUG - {pstm-100011} Types: [java.lang.Integer]
DEBUG - {rset-100012} ResultSet
DEBUG - {rset-100012} Header: [foo, bar]
DEBUG - {rset-100012} Result: [11, 3]
DEBUG - Returned connection 3976572 to pool.
Those logs were very valuable in determining why things weren't working
the way I thought they should.
--- Clinton Begin <cl...@gmail.com> wrote:
> If you could, that would be a driver level option. iBATIS never
> merges the parameters for you, it lets the PreparedStatement
> implementation do that.
>
> What's the error you're getting?
>
> Clinton
>
>
> On Fri, 24 Dec 2004 14:04:49 -0600, Vic Cekvenich <vi...@friendvu.com>
> wrote:
> > I can't get a simple mapped statement to work:
> >
> > SELECT
> > max(msg_num) as msg_num
> > from load_articles
> > where club_id = #club_id#
> >
> > Anyone know how can I get the real sql that executes with the parm
> and
> > real data returned in debug mode? (when I try in sql console it
> works
> > easily)
> >
> > getSql?
> > getRowSet?
> >
> > get the full sourcecode and trace?
> >
> > tia,
> > .V
> >
> > --
> > RiA-SoA w/JDNC <http://www.SandraSF.com> forums
> > - help develop a coomunity
> > My blog <http://www.sandrasf.com/adminBlog>
> >
>
Re: how to get the real sql
Posted by Clinton Begin <cl...@gmail.com>.
If you could, that would be a driver level option. iBATIS never
merges the parameters for you, it lets the PreparedStatement
implementation do that.
What's the error you're getting?
Clinton
On Fri, 24 Dec 2004 14:04:49 -0600, Vic Cekvenich <vi...@friendvu.com> wrote:
> I can't get a simple mapped statement to work:
>
> SELECT
> max(msg_num) as msg_num
> from load_articles
> where club_id = #club_id#
>
> Anyone know how can I get the real sql that executes with the parm and
> real data returned in debug mode? (when I try in sql console it works
> easily)
>
> getSql?
> getRowSet?
>
> get the full sourcecode and trace?
>
> tia,
> .V
>
> --
> RiA-SoA w/JDNC <http://www.SandraSF.com> forums
> - help develop a coomunity
> My blog <http://www.sandrasf.com/adminBlog>
>