ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Boden <list...@pandora.be>
Subject Re: executeBatch not returning int of records updated.
Date Tue, 20 Jun 2006 19:42:36 GMT
 From the Oracle 9i documentation: "For a prepared statement batch, it 
is not possible to know the number of rows affected in the database by 
each individual statement in the batch. Therefore, all array elements 
have a value of -2. According to the JDBC 2.0 specification, a value of 
-2 indicates that the operation was successful but the number of rows 
affected is unknown."

ibATIS translates the -2 to 0. So it seems it doesn't work on batched 
statemements.

Regards,
Sven

jaybytez wrote:

>Is there a version of Oracle that this depends on.  Currently in our J2EE
>framework we can check the int[] and int size and value everytime we do a
>delete/insert/update.  We are actually able to do successful tests against
>the value in an int against PreparedStatement.SUCCESS_NO_INFO for instance.
>
>For example, this currently works if I use straight Jdbc.
>
>		int results[] = ps.executeBatch();
>		for (int i=0; i<results.length; i++) {
>			int result = results[i];
>		    if ((result != PreparedStatement.SUCCESS_NO_INFO) && (result != 1)) {
>		    	BaseTO object = null;
>		    	if (list != null) { object = (BaseTO)list.get(i); }
>	            throw new RuntimeException(label + " result=" + result + ",
>expecting 1: " + 
>	            		(object == null ? "" : object.toString()));
>		    }
>		}
>
>Thanks for your info...
>
>-jay
>--
>View this message in context: http://www.nabble.com/executeBatch-not-returning-int-of-records-updated.-t1819686.html#a4961768
>Sent from the iBATIS - User - Java forum at Nabble.com.
>
>
>
>  
>


Mime
View raw message