Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 47789 invoked from network); 9 Sep 2005 02:41:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Sep 2005 02:41:46 -0000 Received: (qmail 1966 invoked by uid 500); 9 Sep 2005 02:41:45 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 1950 invoked by uid 500); 9 Sep 2005 02:41:44 -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 1937 invoked by uid 99); 9 Sep 2005 02:41:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Sep 2005 19:41:44 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=HTML_30_40,HTML_MESSAGE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of brandon.goodin@gmail.com designates 64.233.170.196 as permitted sender) Received: from [64.233.170.196] (HELO rproxy.gmail.com) (64.233.170.196) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Sep 2005 19:41:57 -0700 Received: by rproxy.gmail.com with SMTP id c16so20585rne for ; Thu, 08 Sep 2005 19:41:40 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=qceA6j3muCHX9sJtPFjhussBcQrIOyAbyb04FO3Wo342UstwnjE9x8yM7RbFT5stqR9BP+G0uZlCx+FsinIXQhLYA2LnOLJOhy8jafjJtgClpO8Y4fLVoKDNn3U1mi8XS33/yJzerKD2Nik8cYzXTz2/Teqw9dNBvFp8W5C9ttw= Received: by 10.38.98.76 with SMTP id v76mr52525rnb; Thu, 08 Sep 2005 19:41:40 -0700 (PDT) Received: by 10.38.74.11 with HTTP; Thu, 8 Sep 2005 19:41:39 -0700 (PDT) Message-ID: <2fe5ef5b05090819412a34da5a@mail.gmail.com> Date: Thu, 8 Sep 2005 20:41:39 -0600 From: Brandon Goodin Reply-To: brandon.goodin@gmail.com To: user-java@ibatis.apache.org, pkarth@gmail.com Subject: Re: help required for insert() In-Reply-To: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_61_8939598.1126233699996" References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_61_8939598.1126233699996 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline The following is provided in the javadoc. I hope that helps. =20 insert=20 public java.lang.Object *insert*(java.lang.String id, java.lang.Object parameterObject) throws java.sql.SQLException Executes a mapped SQL INSERT statement. Insert is a bit different from=20 other update methods, as it provides facilities for returning the primary= =20 key of the newly inserted row (rather than the effected rows). This=20 functionality is of course optional.=20 The parameter object is generally used to supply the input data for the=20 INSERT values.=20 *Parameters:*id - The name of the statement to execute.parameterObject - Th= e=20 parameter object (e.g. JavaBean, Map, XML etc.). *Returns:*The primary key= =20 of the newly inserted row. This might be automatically generated by the=20 RDBMS, or selected from a sequence table or other source. *Throws:*=20 java.sql.SQLException - If an error occurs. =20 ------------------------------ update=20 public int *update*(java.lang.String id, java.lang.Object parameterObject) throws java.sql.SQLException Executes a mapped SQL UPDATE statement. Update can also be used for any=20 other update statement type, such as inserts and deletes. Update returns th= e=20 number of rows effected.=20 The parameter object is generally used to supply the input data for the=20 UPDATE values as well as the WHERE clause parameter(s).=20 *Parameters:*id - The name of the statement to execute.parameterObject - Th= e=20 parameter object (e.g. JavaBean, Map, XML etc.). *Returns:*The number of=20 rows effected. *Throws:* java.sql.SQLException - If an error occurs. =20 ------------------------------ delete=20 public int *delete*(java.lang.String id, java.lang.Object parameterObject) throws java.sql.SQLException Executes a mapped SQL DELETE statement. Delete returns the number of rows= =20 effected.=20 The parameter object is generally used to supply the input data for the=20 WHERE clause parameter(s) of the DELETE statement.=20 *Parameters:*id - The name of the statement to execute.parameterObject - Th= e=20 parameter object (e.g. JavaBean, Map, XML etc.). *Returns:*The number of=20 rows effected. *Throws:* java.sql.SQLException - If an error occurs. =20 On 9/8/05, Karthikeyan Pandurangan wrote: >=20 > ---------- Forwarded message ---------- > From: Karthikeyan Pandurangan > Date: Sep 9, 2005 9:01 AM > Subject: help required for insert() > To: user-java-info@ibatis.apache.org >=20 >=20 > Hi, > I have a problem in using insert() in ibatis 2.1.5 with SQLMap. As > there is no proper sample and doc explaining the usage of > insert and the type of the returned object when insert is carried out. > As i used Ibatis 1.3 SQLMap update() for insertion, > i don't know how to handle the insertion using v2.1.5 insert(). Even > the sample application packaged with v2.1.5 doesn't > seams to use insert(), instead it is using insert(). Please help me to > solve this problem. Thanks in advance. >=20 > Regards > karthi > ------=_Part_61_8939598.1126233699996 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline

The following is provided in the javadoc. I hope that helps.


insert

public java.lang.Object insert(java.lang.String id,
= java.lang.Object parameterObject)
= throws java.sql.SQLException
Executes a mapped SQL INSERT statement. Insert is a bit different from other update methods, as it provides facilities for returning the primary key of the newly inserted row (rather than the effected rows). This functionality is of course optional.

The parameter object is generally used to supply the input data for the INSERT values.

Parameters:
id - The name = of the statement to execute.
parameterObject - The par= ameter object (e.g. JavaBean, Map, XML etc.).
Returns:
The primary key of the newly inserted row.= This might be automatically generated by the RDBMS, or selected from a sequence table or other= source.
Throws:
java.sql.SQLException - If an error occurs.

update

public int update(java.lang.String id,
= java.lang.Object parameterObject)
throws java.sql.SQLE= xception
Executes a mapped SQL UPDATE statement. Update can also be used for any other update statement type, such as inserts and deletes. Update returns the number of rows effected.

The parameter object is generally used to supply the input data for the UPDATE values as well as the WHERE clause parameter(s).

Parameters:
id - The name = of the statement to execute.
parameterObject - The par= ameter object (e.g. JavaBean, Map, XML etc.).
Returns:
The number of rows effected.
Throws:
java.sql.SQLException - If an error occurs.

delete

public int delete(java.lang.String id,
= java.lang.Object parameterObject)
throws java.sql.SQLE= xception
Executes a mapped SQL DELETE statement. Delete returns the number of rows effected.

The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the DELETE statement.

Parameters:
id - The name = of the statement to execute.
parameterObject - The par= ameter object (e.g. JavaBean, Map, XML etc.).
Returns:
The number of rows effected.
Throws:
java.sql.SQLException - If an error occurs.


On 9/8/05, Karthikeyan Pandurangan <= pkarth@gmail.com> wrote:
---------- Forwarded message ----------
From: Karthikeyan Pandurangan &l= t;pkarth@gmail.com>
Date: Sep= 9, 2005 9:01 AM
Subject: help required for insert()
To: user-java-info@ibatis.apache.org


Hi,
   I have = a problem in using insert() in ibatis 2.1.5 with SQLMap. As
there is no&= nbsp; proper sample and doc explaining the usage of
insert and the = type of the returned object when insert is carried out.
As i used Ibatis 1.3 SQLMap update() for insertion,
i don't know how= to handle the insertion using v2.1.5 insert(). Even
the sample applicat= ion packaged with v2.1.5 doesn't
seams to use insert(), instead it is us= ing insert(). Please help me to
solve this problem. Thanks in advance.

Regards
karthi

------=_Part_61_8939598.1126233699996--