Have you checked that your statements actually update some data? Maybe
the WHERE clause of your update is wrong and nothing is updated.

Have you tried executing your statement without the batch?

On Thu, 16 Feb 2006 11:42:43 -0500, "Krishnamoorthi, Sruthi (Raytheon)"
<[EMAIL PROTECTED]> said:
> Hello,
> Could you please help me out on this issue.
> executeBatch is always returning zero.
> Could you please look into this code and reply me ASAP. I have an
> urgency.
> 
> 
> MyCode:
> public int updtFlCntList(ArrayList docCnts)throws  FileContentException
>       {
>               int updCount = 0;
>               try 
>               {
>                       sqlMap.startTransaction();
>                       sqlMap.startBatch();
>                       for (int i=0;i<docCnts.size();i++)
>                       {
>                               
> System.out.println("updtFlCntList"+((Document)docCnts.get(i)).toString());
>                               
> sqlMap.update("updtFlCntsList",(Document)docCnts.get(i));
>                               
>                       }
>                        updCount = sqlMap.executeBatch();
>                        System.out.println("updCount:-"+updCount);
>                       sqlMap.commitTransaction();
>               }
>               catch (SQLException e)
>               {
>                       try 
>                       {
>                               sqlMap.endTransaction(); 
>                       } 
>                       catch(SQLException se) 
>                       {
>                               throw new RuntimeException("SQLException:"+se);
>                       }
>                       logger.debug(e.getMessage());
>                       throw new FileContentException(e.getMessage());
>               }
>               finally
>               {
>                       try 
>                       {
>                               sqlMap.endTransaction(); 
>                       } 
>                       catch(SQLException se) 
>                       {
>                               throw new RuntimeException("SQLException:"+se);
>                       }
>               }
>               return updCount;
>               
>       }
> 
> Thanks,
> Sruthi Krishnamoorthi
> 703-562-9732(Work)
> 537 A - (Raytheon) Location 
> 
> 
--
==================================
[EMAIL PROTECTED]

Reply via email to