/** * Maakt de opgegeven security aan in de database * * @param entity Het object dat moet worden aangemaakt in de database * @return * @throws StockPlayException */ public boolean update(Exchange entity) throws StockPlayException { Connection conn = null; PreparedStatement stmt = null; ResultSet rs = null; try { try { conn = OracleConnection.getConnection(); stmt = conn.prepareStatement(UPDATE_EXCHANGE); stmt.setString(3, entity.getSymbol()); stmt.setString(1, entity.getName()); stmt.setString(2, entity.getLocation()); return stmt.executeUpdate() == 1; } finally { if (rs != null) { rs.close(); } if (stmt != null) { stmt.close(); } if (conn != null) { conn.close(); } } } catch (SQLException ex) { throw new SubsystemException(SubsystemException.Type.DATABASE_FAILURE, ex.getCause()); } }