Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 42F822E3400 for ; Thu, 6 Dec 2007 03:14:14 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 54902-01 for ; Thu, 6 Dec 2007 03:14:10 -0400 (AST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.176]) by postgresql.org (Postfix) with ESMTP id 164CE2E3120 for ; Thu, 6 Dec 2007 03:14:09 -0400 (AST) Received: by wa-out-1112.google.com with SMTP id m38so328916waf for ; Wed, 05 Dec 2007 23:14:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=GrykBaFFczW6fOF73RZoaG9karhyi06ToQKZyqwscmU=; b=qHC1pFITk1LCdtE7f3T7WQhW11TQ+XJCg9qwpvHu55nv3tIHk04ZRaX3oXvb2BHdKBf3JQO+BVDGTkyDBaZPbtBuumqZ02u4gGV1F4N80rpcbaG/eYzb4L/fE9iXrF0thmGnVW/zCOQYLKemKExVrvIoRNIEsgWTauR0LADd6qU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=GohzkJ1hmse+iRF/8TT5HGdwE3FulG0/B4w1YwdfKMiK4avbS9AdK1MbL1K4nFzMbW+3ghinbpy8modffhpAqLS94rHd71sLGH67FmcxWD/CchnBMvllyBZe9LDy5VHsoG+k1vCH6llIxm91dOnKkld7lXzErOGXDlVpNVz6c+A= Received: by 10.115.95.1 with SMTP id x1mr1307534wal.1196925248169; Wed, 05 Dec 2007 23:14:08 -0800 (PST) Received: by 10.114.208.9 with HTTP; Wed, 5 Dec 2007 23:14:08 -0800 (PST) Message-ID: <4478b4ac0712052314p8a1875dm424b8e8c7645b0df@mail.gmail.com> Date: Thu, 6 Dec 2007 12:44:08 +0530 From: "Kranti K K Parisa [GetSet-India]" To: "Kris Jurka" Subject: Re: BatchUpdate exception Cc: pgsql-jdbc@postgresql.org In-Reply-To: <4478b4ac0712050802g595852dcq8a1e2efb886c5853@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1606_21884217.1196925248159" References: <4478b4ac0712050624u18cf3e8en81990c67ddf9da92@mail.gmail.com> <4478b4ac0712050752kae43d65p46c5c08645d1e755@mail.gmail.com> <4478b4ac0712050802g595852dcq8a1e2efb886c5853@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/39 X-Sequence-Number: 17894 ------=_Part_1606_21884217.1196925248159 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Kris, No Luck with that! My Test java program look like this ------------ try{ for (int i=0;i<200;i++){ //System.out.println("inside outer==>>"+i); for(int j=0;j<4;j++){ proc=null; //System.out.println("inside inner==>>"+j); proc=con.prepareCall("{call client255271111.test_function()}"); //proc.registerOutParameter(1, Types.INTEGER); proc.addBatch(); } } int []intUpdates=proc.executeBatch(); System.out.println("intUpdates length==>>"+intUpdates.length); for(int i=0;i>"+i); System.out.println("i value is==>>"+intUpdates[i]); al.add(new Integer(intUpdates[i])); } }catch(SQLException e){ System.out.println(e.getNextException()); } -------------------------- and SP look like =========== CREATE OR REPLACE FUNCTION test_function() RETURNS int4 AS $BODY$ declare begin raise notice 'testing the Stored proc%','SP Tested'; return 1; end; $BODY$ LANGUAGE 'plpgsql' VOLATILE; ALTER FUNCTION test_function() OWNER TO postgres; ======================== The results when i run the java program are: intUpdates length==>>1 i number is==>>0 i value is==>>0 test size===>>[0] which shows the SP is not getting executed for all the times?? please suggest. On Dec 5, 2007 9:32 PM, Kranti K K Parisa [GetSet-India] < kranti.parisa@gmail.com> wrote: > excellent. let me try and update you > > thanks! > > > On Dec 5, 2007 9:26 PM, Kris Jurka wrote: > > > > > > > On Wed, 5 Dec 2007, Kranti K K Parisa [GetSet-India] wrote: > > > > > We are using Postgres 8.1 version. Does this mean we need to upgrade > > the > > > database version also? or can use the driver with latest release? > > > > > > > You can use the 8.3 driver with any server version >= 7.2. > > > > Kris Jurka > > > > > > -- > ------------------ > Best Regards > Kranti Kiran Kumar Parisa > Mobile: +91 - 9849 - 625 - 625 > +91 - 9391 - 438 - 738 > -- ------------------ Best Regards Kranti Kiran Kumar Parisa Mobile: +91 - 9849 - 625 - 625 +91 - 9391 - 438 - 738 ------=_Part_1606_21884217.1196925248159 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Kris,

No Luck with that!

My Test java program look like this

------------
try{
            for (int i=0;i<200;i++){
                //System.out.println("inside outer==>>"+i);
                for(int j=0;j<4;j++){
                    proc=null;
                    //System.out.println("inside inner==>>"+j);
                    proc=con.prepareCall("{call client255271111.test_function ()}");
                    //proc.registerOutParameter(1, Types.INTEGER);
                    proc.addBatch();
                }
            }
            int []intUpdates=proc.executeBatch();
            System.out.println("intUpdates length==>>"+intUpdates.length);
            for(int i=0;i<intUpdates.length;i++){
                System.out.println("i number is==>>"+i);
                System.out.println("i value is==>>"+intUpdates[i]);
                al.add(new Integer(intUpdates[i]));
            }
        }catch(SQLException e){
            System.out.println(e.getNextException ());
        }
--------------------------

and SP look like
===========
CREATE OR REPLACE FUNCTION test_function()
  RETURNS int4 AS
$BODY$
 declare
begin
raise notice 'testing the Stored proc%','SP Tested';

return 1;
end;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION test_function() OWNER TO postgres;
========================

The results when i run the java program are:

intUpdates length==>>1
i number is==>>0
i value is==>>0
test size===>>[0]


which shows the SP is not getting executed for all the times??

please suggest.


On Dec 5, 2007 9:32 PM, Kranti K K Parisa [GetSet-India] < kranti.parisa@gmail.com> wrote:
excellent. let me try and update you

thanks!


On Dec 5, 2007 9:26 PM, Kris Jurka <books@ejurka.com> wrote:


On Wed, 5 Dec 2007, Kranti K K Parisa [GetSet-India] wrote:

> We are using Postgres 8.1 version. Does this mean we need to upgrade the
> database version also? or can use the driver with latest release?
>

You can use the 8.3 driver with any server version >= 7.2.

Kris Jurka



--
------------------
Best Regards
Kranti Kiran Kumar Parisa
Mobile: +91 - 9849 - 625 - 625
           +91 - 9391 - 438 - 738



--
------------------
Best Regards
Kranti Kiran Kumar Parisa
Mobile: +91 - 9849 - 625 - 625
           +91 - 9391 - 438 - 738 ------=_Part_1606_21884217.1196925248159--