public int[] executeBatch() throws SQLException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); 
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(this, tc, "executeBatch");

        int[] results;

        try {
            if (childWrapper != null) {
                closeAndRemoveResultSet();
            }

            if (childWrappers != null && !childWrappers.isEmpty()) {
                closeAndRemoveResultSets();
            }

            parentWrapper.beginTransactionIfNecessary();

            enforceStatementProperties();

            results = stmtImpl.executeBatch();

            // Batch parameters are cleared after executing the batch.  So reset the
            // batch parameter flag. 

            hasBatchParameters = false; 

        } catch (BatchUpdateException batchX) {
            // No FFDC code needed. Might be an application error. 

            if (isTraceOn && tc.isDebugEnabled())
                Tr.debug(this, tc, "Check for Connection Error", AdapterUtil.getStackTraceWithState(batchX));

            // Ask the helper if this is a Connection Error, but don't actually map
            // the exception, since the user would have no way of knowing it's a
            // BatchUpdateException if we map it to something else.

            try {
                WSJdbcConnection connWrapper = (WSJdbcConnection) parentWrapper;

                if (mcf.getHelper().isConnectionError(batchX)) {
                    if (tc.isEventEnabled())
                        Tr.event(this, tc,
                                 "Encountered a Stale Connection: ", connWrapper);

                    connWrapper.fireConnectionErrorEvent(batchX, true);
                }
            } catch (NullPointerException nullX) {
                // No FFDC code needed; we might be closed.
                if (isTraceOn && tc.isEntryEnabled())
                    Tr.exit(this, tc, "executeBatch", "Exception");
                throw runtimeXIfNotClosed(nullX);
            }

            if (isTraceOn && tc.isEntryEnabled())
                Tr.exit(this, tc, "executeBatch", "Exception");
            throw batchX;
        } catch (SQLException sqlX) {
            // No FFDC code needed. Might be an application error. 
            // map as usual
            if (isTraceOn && tc.isEntryEnabled())
                Tr.exit(this, tc, "executeBatch", sqlX); 
            throw WSJdbcUtil.mapException(this, sqlX);
        } catch (NullPointerException nullX) {
            // No FFDC code needed; we might be closed.
            if (isTraceOn && tc.isEntryEnabled())
                Tr.exit(this, tc, "executeBatch", "Exception");
            throw runtimeXIfNotClosed(nullX);
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(this, tc, "executeBatch", Arrays.toString(results));
        return results;
    }
public int [ ] executeBatch ( ) throws SQLException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "executeBatch" ) ; int [ ] results ; try { if ( childWrapper != null ) { closeAndRemoveResultSet ( ) ; } if ( childWrappers != null && ! childWrappers . isEmpty ( ) ) { closeAndRemoveResultSets ( ) ; } parentWrapper . beginTransactionIfNecessary ( ) ; enforceStatementProperties ( ) ; results = stmtImpl . executeBatch ( ) ; hasBatchParameters = false ; } catch ( BatchUpdateException batchX ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Check for Connection Error" , AdapterUtil . getStackTraceWithState ( batchX ) ) ; try { WSJdbcConnection connWrapper = ( WSJdbcConnection ) parentWrapper ; if ( mcf . getHelper ( ) . isConnectionError ( batchX ) ) { if ( tc . isEventEnabled ( ) ) Tr . event ( this , tc , "Encountered a Stale Connection: " , connWrapper ) ; connWrapper . fireConnectionErrorEvent ( batchX , true ) ; } } catch ( NullPointerException nullX ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "executeBatch" , "Exception" ) ; throw runtimeXIfNotClosed ( nullX ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "executeBatch" , "Exception" ) ; throw batchX ; } catch ( SQLException sqlX ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "executeBatch" , sqlX ) ; throw WSJdbcUtil . mapException ( this , sqlX ) ; } catch ( NullPointerException nullX ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "executeBatch" , "Exception" ) ; throw runtimeXIfNotClosed ( nullX ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "executeBatch" , Arrays . toString ( results ) ) ; return results ; }
@see java.sql.Statement#executeBatch()