public static boolean executeSql ( final String sql , final List < Object > paramList , final Connection connection , final boolean isDebug ) throws SQLException { if ( isDebug || LOGGER . isTraceEnabled ( ) ) { LOGGER . log ( Level . INFO , "Executing SQL [" + sql + "]" ) ; } final PreparedStatement preparedStatement = connection . prepareStatement ( sql ) ; for ( int i = 1 ; i <= paramList . size ( ) ; i ++ ) { preparedStatement . setObject ( i , paramList . get ( i - 1 ) ) ; } final boolean isSuccess = preparedStatement . execute ( ) ; preparedStatement . close ( ) ; return isSuccess ; }
Executes the specified SQL with the specified params and connection ...