Re: BatchUpdate exception - Mailing list pgsql-jdbc

From Kranti K K Parisa [GetSet-India]
Subject Re: BatchUpdate exception
Date
Msg-id 4478b4ac0712052314p8a1875dm424b8e8c7645b0df@mail.gmail.com
Whole thread Raw
In response to BatchUpdate exception  ("Kranti K K Parisa [GetSet-India]" <kranti.parisa@gmail.com>)
Responses Re: BatchUpdate exception  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Ken Johanson
Date:
Subject: Re: Synthesize support for Statement.getGeneratedKeys()?
Next
From: Ken Johanson
Date:
Subject: Statement.executeUpdate(String sql, int columnIndexes[]) via RETURNING clause?