core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java
/**
     * Saves a property to the database.
     *
     * @param key the property key
     * @param value the property value
     */
Saves a property to the database.
@param key the property key
@param value the property value
Saves a property to the database . @param key the property key @param value the property value
public synchronized void saveProperty(String key, String value) {
        clearCache();
        try {
            final PreparedStatement mergeProperty = getPreparedStatement(MERGE_PROPERTY);
            if (mergeProperty != null) {
                mergeProperty.setString(1, key);
                mergeProperty.setString(2, value);
                mergeProperty.execute();
            } else {
                final PreparedStatement updateProperty = getPreparedStatement(UPDATE_PROPERTY);
                updateProperty.setString(1, value);
                updateProperty.setString(2, key);
                if (updateProperty.executeUpdate() == 0) {
                    final PreparedStatement insertProperty = getPreparedStatement(INSERT_PROPERTY);
                    insertProperty.setString(1, key);
                    insertProperty.setString(2, value);
                    insertProperty.executeUpdate();
                }
            }
        } catch (SQLException ex) {
            LOGGER.warn("Unable to save property '{}' with a value of '{}' to the database", key, value);
            LOGGER.debug("", ex);
        }
    }
public synchronized void saveProperty ( String key , String value ) { clearCache ( ) ; try { final PreparedStatement mergeProperty = getPreparedStatement ( MERGE_PROPERTY ) ; if ( mergeProperty != null ) { mergeProperty . setString ( 1 , key ) ; mergeProperty . setString ( 2 , value ) ; mergeProperty . execute ( ) ; } else { final PreparedStatement updateProperty = getPreparedStatement ( UPDATE_PROPERTY ) ; updateProperty . setString ( 1 , value ) ; updateProperty . setString ( 2 , key ) ; if ( updateProperty . executeUpdate ( ) == 0 ) { final PreparedStatement insertProperty = getPreparedStatement ( INSERT_PROPERTY ) ; insertProperty . setString ( 1 , key ) ; insertProperty . setString ( 2 , value ) ; insertProperty . executeUpdate ( ) ; } } } catch ( SQLException ex ) { LOGGER . warn ( "Unable to save property '{}' with a value of '{}' to the database" , key , value ) ; LOGGER . debug ( "" , ex ) ; } }
Saves a property to the database.
Saves a property to the database .
// No Merge statement, so doing an Update/Insert...