Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 13069 invoked from network); 7 Mar 2010 15:13:53 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Mar 2010 15:13:53 -0000 Received: (qmail 51553 invoked by uid 500); 7 Mar 2010 15:13:32 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 51509 invoked by uid 500); 7 Mar 2010 15:13:32 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 51502 invoked by uid 99); 7 Mar 2010 15:13:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Mar 2010 15:13:32 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of bhaarat.s@gmail.com designates 209.85.219.222 as permitted sender) Received: from [209.85.219.222] (HELO mail-ew0-f222.google.com) (209.85.219.222) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Mar 2010 15:13:24 +0000 Received: by ewy22 with SMTP id 22so3528743ewy.26 for ; Sun, 07 Mar 2010 07:13:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=EwVHa3sSsDx3zDwcrYqqhlkKgEIGVcUBW0bjKs9JYKk=; b=KFYqYbeOHu3pFqRJuEXm06ZYvrCbHp9INFwvkQjkE7cBIZLdgfD/fX8o3atq5dha1n gRySxnNkvvCoyV6eF+NOMafZs5iU0LXkM66zN8XI0lkWtTbrNAHpe3aXUOPt6S32uSip AmBQP/4r0cTtOXMptoXid2pJ+KRa5O2Rr+CvU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=B8MgWkUDyg35FPCROMRUOOu3yd/yjU3I+CYHM0P3192jT1A/XrZ/5/YDevIQ5X/P0w dLah3Dt1dBUSY6E8MRw9j3eFFqBHPcnpZKp6926T9Qb3zIZlWAm3BYgPsChB+H64lXxL cRB/p7ghqZsIZovvrlrYcKlRoLImA7DPHqXR8= MIME-Version: 1.0 Received: by 10.213.26.138 with SMTP id e10mr2279564ebc.80.1267974784127; Sun, 07 Mar 2010 07:13:04 -0800 (PST) Date: Sun, 7 Mar 2010 10:13:04 -0500 Message-ID: <491bd2b51003070713p4710d169k559558af03beec0a@mail.gmail.com> Subject: How to do logging in iBatis + Spring From: Bhaarat Sharma To: user-java@ibatis.apache.org Content-Type: multipart/alternative; boundary=0015174be8bc9795f4048137620a X-Virus-Checked: Checked by ClamAV on apache.org --0015174be8bc9795f4048137620a Content-Type: text/plain; charset=ISO-8859-1 We use iBatis + Spring and make use of stored procedures to fetch information from Oracle DB. To find out what parameters (HashMap) is sent to the stored procedure we have to actually set debug points. We'd like this information to go to a log. Basically print out name of the Stored Proc + all that a HashMap contains (before calling the Stored procedure). Our setup is as below: Mapping: {call get_rpt (?,?,?,?)}
Our setup is as below:

Mapping:
=A0=A0 =A0<procedure id=3D"getReportData" paramete= rMap=3D"getReportDataCall">
=A0=A0 =A0 =A0 {call get= _rpt (?,?,?,?)}
=A0=A0 =A0</procedure>

=A0=A0 =A0 =A0&l= t;parameterMap id=3D"getReportDataCall" class=3D"map"&g= t;
=A0=A0 =A0 =A0 =A0<parameter property=3D"type" jd= bcType=3D"String" javaType=3D"java.lang.String" mode=3D= "IN"/>
=A0=A0 =A0 =A0 =A0<parameter property=3D"month" jdbcType= =3D"Int" javaType=3D"java.lang.Integer" mode=3D"IN= "/>
=A0=A0 =A0 =A0 =A0<parameter property=3D"Resu= lt0" jdbcType=3D"ORACLECURSOR" javaType=3D"java.sql.Res= ultSet" mode=3D"OUT" resultMap=3D"result1"/>
=A0=A0 =A0 =A0 =A0<parameter property=3D"Result1" jdbcTyp= e=3D"ORACLECURSOR" javaType=3D"java.sql.ResultSet" mode= =3D"OUT" resultMap=3D"result2"/>
=A0=A0 = =A0 =A0</parameterMap>

=A0=A0 =A0 =A0<resultMap id=3D"select-first-res= ult-hq" class=3D"VO">
=A0=A0 =A0 =A0 =A0<res= ult property=3D"column1" column=3D"columna"/>
<= div>=A0=A0 =A0 =A0 =A0<result property=3D"column2" column=3D&q= uot;columnb"/>
=A0=A0 =A0 =A0</resultMap

We call our proc= edures like this:
=A0=A0 =A0HashMap parm =3D new HashMap ();=
=A0=A0 =A0parm.put("type", type_val);
=A0=A0= =A0parm.put("month", month_val);
=A0=A0 =A0getSqlMapClientTemplate().queryForList("mymappingName.g= etReportData", parm);


I could = make a method that would take SP name + HashMap as parm and then just put i= t on the log but then i'd have to explicitly make a call to that method= before I call the Stored procedure. =A0I will take this as the last option= as it involves me touching all my existing code.=A0

Is there any simpler solution to this?
--0015174be8bc9795f4048137620a--