Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 64516 invoked from network); 10 Mar 2006 18:08:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Mar 2006 18:08:21 -0000 Received: (qmail 27351 invoked by uid 500); 10 Mar 2006 18:08:20 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 27013 invoked by uid 500); 10 Mar 2006 18:08:18 -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 27002 invoked by uid 99); 10 Mar 2006 18:08:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Mar 2006 10:08:18 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jeffgbutler@gmail.com designates 66.249.82.198 as permitted sender) Received: from [66.249.82.198] (HELO xproxy.gmail.com) (66.249.82.198) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Mar 2006 10:08:17 -0800 Received: by xproxy.gmail.com with SMTP id h29so532349wxd for ; Fri, 10 Mar 2006 10:07:57 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=M7hbOCSavR4Qp8VSBmr1Q07Hm2koP3It7ueyF8xP0a7JJ7wGJmCWCj7dk85MCiYbiLyOrLBw86u7mt0xcxNb2YyYyl9MZphZQl0dWeiVc/7JW/N7jkE0PKUPhEYoS1abqZUoXv79YR1lwJOGKN3olRgmQyz/4t+qahF5o98et48= Received: by 10.70.75.15 with SMTP id x15mr106399wxa; Fri, 10 Mar 2006 10:07:57 -0800 (PST) Received: by 10.70.70.13 with HTTP; Fri, 10 Mar 2006 10:07:56 -0800 (PST) Message-ID: Date: Fri, 10 Mar 2006 12:07:57 -0600 From: "Jeff Butler" To: user-java@ibatis.apache.org Subject: Re: Urgent help required In-Reply-To: <8AED8A2865F7064989119502BD85729D5818B1@EXCHANGE3.uspto.gov> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7792_12527003.1142014077000" References: <8AED8A2865F7064989119502BD85729D5818B1@EXCHANGE3.uspto.gov> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_7792_12527003.1142014077000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline You woldn't - is used for automatically generated keys (like identity fields or sequences). In your case, the insert worked if no exception is thrown. Jeff Butler On 3/10/06, Krishnamoorthi, Sruthi (Raytheon) < Sruthi.Krishnamoorthi@uspto.gov> wrote: > > How to use that select key to tell if my values are inserted or not. > > INSERT INTO > PARTICIPANT(PRTCPNT_ID,GIVEN_NM,MIDDLE_NM,FAMILY_NM,NAME_LINE_ONE_TX, > > CITIZENSHIP,STREET_LINE_ONE_TX,STREET_LINE_TWO_TX, > > CITY_NM,GEOGRAPHIC_REGION_CD,COUNTRY_CD,POSTAL_CD,PRIMARY_TELEPHONE_NO,PR= IMARY_EMAIL_ADDRESS_TX,PASSWORD_TX, > > LAST_MODIFIED_USER_ID,LAST_MODIFIED_TS) > VALUES((select NVL(max(PRTCPNT_ID)+1,1)userId from PARTICIPANT), > > #fname#,#mname#,#lname#,#fname#,#citizenShip#,#street1#,#street2#,#city#,= #state#,#country#,#postalCode#,#phone#,#email#,#password#,'US1234',SYSDATE) > > > Where would I use it here and how > > Thanks, > Sruthi Krishnamoorthi > 703-562-9732(Work) > 537 A - (Raytheon) Location > > > -----Original Message----- > From: larry.meadors@gmail.com [mailto:larry.meadors@gmail.com]On Behalf > Of Larry Meadors > Sent: Friday, March 10, 2006 12:58 PM > To: user-java@ibatis.apache.org > Subject: Re: Urgent help required > > > I think you only get a value back if you use selectKey. > > Larry > > > On 3/10/06, Krishnamoorthi, Sruthi (Raytheon) > wrote: > > > > This is throwing an exception because > > > > > > Integer test =3D (Integer)sqlMap.insert(qryId,usr); > > > > System.out.println("Return value from Insert"+test); id displaying Null > > value: > > But a record is getting inserted in Database. //For sure > > How to confirm that my record got inserted. > > > > > > Thanks, > > Sruthi Krishnamoorthi > > 703-562-9732(Work) > > 537 A - (Raytheon) Location > > > > -----Original Message----- > > From: Nathan.Maves@Sun.COM [mailto:Nathan.Maves@Sun.COM] > > Sent: Friday, March 10, 2006 12:52 PM > > To: user-java@ibatis.apache.org > > Subject: Re: Urgent help required > > Importance: High > > > > Just use > > > > > > Integer rows =3D ((Integer)sqlMap.insert("insertProduct", > > product)).intValue(); > > > > > > if you are using Java 1.5 > > > > > > int rows =3D (Integer)sqlMap.insert("insertProduct", > > product); > > > > > > Nathan > > > > > > > > > > > > On Mar 10, 2006, at 10:41 AM, Krishnamoorthi, Sruthi (Raytheon) wrote: > > > > > > > > > > The docs says > > > > int rows =3D sqlMap.insert ("insertProduct", product); > > > > returns a int value > > > > > > > > When I code it ,the return value is object. I am not able to get the in= t > > return value. Please help me out. > > > > > > Thanks, > > Sruthi Krishnamoorthi > > 703-562-9732(Work) > > 537 A - (Raytheon) Location > > > > > > > > > ------=_Part_7792_12527003.1142014077000 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
You woldn't - <selectKey> is used for automatically generated ke= ys (like identity fields or sequences).  In your case, the insert work= ed if no exception is thrown.
 
Jeff Butler

 
On 3/10/06, = Krishnamoorthi, Sruthi (Raytheon) <Sruthi.Krishnamoorthi@uspto.gov> wrote:
How to use that select key to te= ll if my values are inserted or not.
<insert id=3D"insertCCUser&= quot; parameterClass=3D"user">
       INSERT INTO PARTICIPANT(PRTCPNT_ID= ,GIVEN_NM,MIDDLE_NM,FAMILY_NM,NAME_LINE_ONE_TX,
    =             &nb= sp;            =             &nb= sp;            = CITIZENSHIP,STREET_LINE_ONE_TX,STREET_LINE_TWO_TX,
   &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp; CITY_NM,GEOGRAPHIC_REGION_CD,COUNTRY_CD,POSTAL_CD,PRIMARY_TELEPHONE_NO= ,PRIMARY_EMAIL_ADDRESS_TX,PASSWORD_TX,
            = ;            &n= bsp;            = ;            &n= bsp;     LAST_MODIFIED_USER_ID,LAST_MODIFIED_TS)
&nb= sp;      VALUES((select NVL(max(PRTCPNT_ID)+1,1)us= erId from PARTICIPANT),
        =             &nb= sp;  #fname#,#mname#,#lname#,#fname#,#citizenShip#,#street1#,#street2#= ,#city#,#state#,#country#,#postalCode#,#phone#,#email#,#password#,'US1234',= SYSDATE)
</insert>

Where would I use it here and how

Thanks,=
Sruthi Krishnamoorthi
703-562-9732(Work)
537 A - (Raytheon) Locat= ion


-----Original Message-----
From: larry.meadors@gmail.com [mailto:larry.meadors@gmail.com]On Behalf
Of Larry Meadors
Sent: Frid= ay, March 10, 2006 12:58 PM
To: user-java@ibatis.apache.org
Subject: Re: Urgent help required

I think you only get a value back if you use selectKey.

Larry

On 3/10/06, Krishnamoorthi, Sruthi (Raytheon)
< Sruthi.Krishnamoorthi@uspto.gov> wrote:
>
> This is thro= wing an exception because
>
>
> Integer test =3D (Integer= )sqlMap.insert(qryId,usr);
>
> System.out.println("Return = value from Insert"+test); id displaying Null
> value:
> But a record is getting inserted in Database. //For= sure
> How to confirm that my record got inserted.
>
>> Thanks,
> Sruthi Krishnamoorthi
> 703-562-9732(Work)
> 537 A - (Raytheon) Location
>
> -----Original Message-= ----
> From: Nathan.Maves@Sun= .COM [mailto:Nathan.Maves@Sun.C= OM ]
> Sent: Friday, March 10, 2006 12:52 PM
> To: user-java@ibatis.apache.org
>= Subject: Re: Urgent help required
> Importance: High
>
>= Just use
>
>
> Integer rows =3D ((Integer)sqlMap.insert("ins= ertProduct",
> product)).intValue();
>
>
> if = you are using Java 1.5
>
>
> int rows =3D (Integer)sqlMap= .insert("insertProduct",
> product);
>
>
> Nathan
>
>
>>
>
> On Mar 10, 2006, at 10:41 AM, Krishnamoorthi, Sruthi= (Raytheon) wrote:
>
>
>
>
> The docs says
>
>         int rows = =3D sqlMap.insert ("insertProduct", product);
>
> ret= urns a int value
>
>
>
> When I code it ,the return= value is object. I am not able to get the int
> return value. Please help me out.
>
>
> Thanks,<= br>> Sruthi Krishnamoorthi
> 703-562-9732(Work)
> 537 A - (R= aytheon) Location
>
>
>



------=_Part_7792_12527003.1142014077000--