From: Kranti K K Parisa [GetSet-India] <kranti.parisa@gmail.com>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: BatchUpdate exception
Date: Thu, 6 Dec 2007 12:44:08 +0530
Message-ID: <4478b4ac0712052314p8a1875dm424b8e8c7645b0df@mail.gmail.com> (raw)
In-Reply-To: <4478b4ac0712050802g595852dcq8a1e2efb886c5853@mail.gmail.com>
References: <4478b4ac0712050624u18cf3e8en81990c67ddf9da92@mail.gmail.com>
<Pine.BSO.4.64.0712051035140.24930@leary.csoft.net>
<4478b4ac0712050752kae43d65p46c5c08645d1e755@mail.gmail.com>
<Pine.BSO.4.64.0712051055490.24930@leary.csoft.net>
<4478b4ac0712050802g595852dcq8a1e2efb886c5853@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: kranti.parisa@gmail.com, books@ejurka.com
Subject: Re: BatchUpdate exception
In-Reply-To: <4478b4ac0712052314p8a1875dm424b8e8c7645b0df@mail.gmail.com>
References: <4478b4ac0712050624u18cf3e8en81990c67ddf9da92@mail.gmail.com> <Pine.BSO.4.64.0712051035140.24930@leary.csoft.net> <4478b4ac0712050752kae43d65p46c5c08645d1e755@mail.gmail.com> <Pine.BSO.4.64.0712051055490.24930@leary.csoft.net> <4478b4ac0712050802g595852dcq8a1e2efb886c5853@mail.gmail.com> <4478b4ac0712052314p8a1875dm424b8e8c7645b0df@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox