private static < T > void setParamsExecute ( final T target , final Introspected introspected , final FieldColumnInfo [ ] fcInfos , final PreparedStatement stmt , final boolean checkExistingId , final Set < String > excludedColumns ) throws SQLException { final int [ ] parameterTypes = getParameterTypes ( stmt ) ; int parameterIndex = setStatementParameters ( target , introspected , fcInfos , /*hasSelfJoinColumn*/ stmt , parameterTypes , excludedColumns ) ; // If there is still a parameter left to be set, it's the ID used for an update if ( parameterIndex <= parameterTypes . length ) { for ( final Object id : introspected . getActualIds ( target ) ) { stmt . setObject ( parameterIndex , id , parameterTypes [ parameterIndex - 1 ] ) ; ++ parameterIndex ; } } stmt . executeUpdate ( ) ; fillGeneratedId ( target , introspected , stmt , checkExistingId ) ; }
You should close stmt by yourself