public int update ( Connection conn , String sql , Object [ ] params , int [ ] paramTypes ) throws SQLException { if ( ( paramTypes != null ) && params . length != paramTypes . length ) { throw new IllegalArgumentException ( "Sizes of params and paramTypes must be equal!" ) ; } PreparedStatement stmt = null ; int rows = 0 ; try { stmt = this . prepareStatement ( conn , sql ) ; this . fillStatement ( stmt , params , paramTypes ) ; rows = stmt . executeUpdate ( ) ; } catch ( SQLException e ) { this . rethrow ( e , sql , params ) ; } finally { close ( stmt ) ; } return rows ; }
Execute an SQL INSERT UPDATE or DELETE query .