dependency-check-core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java
/**
     * Prepares all statements to be used.
     *
     * @throws DatabaseException thrown if there is an error preparing the
     * statements
     */
Prepares all statements to be used.
@throws DatabaseException thrown if there is an error preparing the
statements
Prepares all statements to be used . @throws DatabaseException thrown if there is an error preparing the statements
private void prepareStatements() throws DatabaseException {
        for (PreparedStatementCveDb key : values()) {
            PreparedStatement preparedStatement = null;
            try {
                final String statementString = statementBundle.getString(key.name());
                if (key == INSERT_VULNERABILITY || key == INSERT_CPE) {
                    preparedStatement = connection.prepareStatement(statementString, new String[]{"id"});
                } else {
                    preparedStatement = connection.prepareStatement(statementString);
                }
            } catch (SQLException ex) {
                throw new DatabaseException(ex);
            } catch (MissingResourceException ex) {
                if (!ex.getMessage().contains("key MERGE_PROPERTY")) {
                    throw new DatabaseException(ex);
                }
            }
            if (preparedStatement != null) {
                preparedStatements.put(key, preparedStatement);
            }
        }
    }
private void prepareStatements ( ) throws DatabaseException { for ( PreparedStatementCveDb key : values ( ) ) { PreparedStatement preparedStatement = null ; try { final String statementString = statementBundle . getString ( key . name ( ) ) ; if ( key == INSERT_VULNERABILITY || key == INSERT_CPE ) { preparedStatement = connection . prepareStatement ( statementString , new String [ ] { "id" } ) ; } else { preparedStatement = connection . prepareStatement ( statementString ) ; } } catch ( SQLException ex ) { throw new DatabaseException ( ex ) ; } catch ( MissingResourceException ex ) { if ( ! ex . getMessage ( ) . contains ( "key MERGE_PROPERTY" ) ) { throw new DatabaseException ( ex ) ; } } if ( preparedStatement != null ) { preparedStatements . put ( key , preparedStatement ) ; } } }
Prepares all statements to be used.
Prepares all statements to be used .